Merge branch 'dev' into 'main'

Updated scripts to use esm syntax

See merge request illegitimate/illegitimate-bot!275
This commit is contained in:
2024-09-08 20:58:12 +00:00
9 changed files with 311 additions and 473 deletions

View File

@@ -2,10 +2,7 @@
"$schema": "https://json.schemastore.org/nodemon.json",
"restartable": "rs",
"ignore": [
".git",
"node_modules",
"src",
"data"
"node_modules"
],
"verbose": true,
"env": {

View File

@@ -1,9 +1,7 @@
{
"$schema": "https://json.schemastore.org/nodemon.json",
"ignore": [
".git",
"node_modules",
"data"
"node_modules"
],
"env": {
"NODE_ENV": "dev"

View File

@@ -2,13 +2,10 @@
"$schema": "https://json.schemastore.org/nodemon.json",
"restartable": "rs",
"ignore": [
".git",
"node_modules",
"data"
"node_modules"
],
"verbose": true,
"env": {
"NODE_PATH": "src/",
"NODE_ENV": "dev",
"TYPESCRIPT": "true"
},

View File

@@ -16,16 +16,15 @@
"build": "swc src -d dist --strip-leading-paths",
"watch": "swc src -d dist --strip-leading-paths --watch",
"dev": "nodemon --config nodemon-swc.json",
"dev:conc": "conc --names \"SWC,BOT\" --prefix-colors \"blue, magenta\" \"yarn watch\" \"yarn dev:js\"",
"dev:ts": "nodemon --config nodemon.json src/index.ts",
"dev:js": "nodemon --config nodemon-js.json dist/index.js",
"format": "dprint fmt \"**/*.ts\"",
"check": "tsc --noEmit",
"lint": "eslint",
"lint:fix": "eslint --fix",
"push:prod": "cross-env NODE_PATH=src/ \"ts-node scripts/deploy-commands.ts\"",
"push:dev": "cross-env NODE_PATH=src/ \"ts-node scripts/dev-deploy.ts\"",
"delete:dev": "ts-node scripts/delete-commands.ts"
"push:prod": "tsx scripts/deploy-commands.ts",
"push:dev": "tsx scripts/dev-deploy.ts",
"delete:dev": "tsx scripts/delete-commands.ts"
},
"author": "Taken",
"license": "GPL-3.0-only",
@@ -33,15 +32,15 @@
"@discord-player/extractor": "^4.5.1",
"@evan/opus": "^1.0.3",
"anilist": "^0.12.4",
"axios": "^1.7.5",
"axios": "^1.7.7",
"chalk": "^5.3.0",
"cron": "^3.1.7",
"discord-player": "^6.7.1",
"discord-player-youtubei": "^1.2.6",
"discord.js": "^14.15.3",
"discord-player-youtubei": "^1.3.1",
"discord.js": "^14.16.1",
"dotenv": "^16.4.5",
"ioredis": "^5.4.1",
"mongoose": "^8.5.3",
"mongoose": "^8.6.1",
"ms": "^2.1.3",
"pg": "^8.12.0",
"pg-hstore": "^2.3.4",
@@ -51,23 +50,21 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.9.0",
"@eslint/js": "^9.10.0",
"@swc/cli": "^0.4.0",
"@swc/core": "^1.7.14",
"@swc/core": "^1.7.24",
"@types/ms": "^0.7.34",
"@types/node": "^22.5.0",
"@types/node": "^22.5.4",
"@types/pg": "^8",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^8.4.0",
"@typescript-eslint/parser": "^8.4.0",
"chokidar": "^3.6.0",
"concurrently": "^8.2.2",
"cross-env": "^7.0.3",
"dprint": "^0.47.2",
"eslint": "^9.9.0",
"eslint": "^9.10.0",
"globals": "^15.9.0",
"sqlite3": "^5.1.7",
"tsx": "^4.19.0",
"typescript": "^5.5.4"
},
"packageManager": "yarn@4.4.0"
"packageManager": "yarn@4.4.1"
}

View File

@@ -3,7 +3,6 @@ import env from "../src/utils/Env"
const rest = new REST({ version: "10" }).setToken(env.dev.devtoken)
async function deleteCommands() {
try {
console.log("Started deleting application (/) commands.")
await rest.put(
@@ -14,5 +13,3 @@ async function deleteCommands() {
} catch (error) {
console.error(error)
}
}
deleteCommands()

View File

@@ -10,15 +10,14 @@ const commandFiles = fs.readdirSync("./src/commands").filter(file => file.endsWi
const contentMenuCommands = fs.readdirSync("./src/commands-contextmenu").filter(file => file.endsWith(".ts"))
for (const file of commandFiles) {
const command: ICommand = require(`../src/commands/${file}`)
const { default: command } = await import(`../src/commands/${file}`) as { default: ICommand }
commands.push(command.data.toJSON())
}
for (const file of contentMenuCommands) {
const command: ICommand = require(`../src/commands-contextmenu/${file}`)
const { default: command } = await import(`../src/commands-contextmenu/${file}`) as { default: ICommand }
commands.push(command.data.toJSON())
}
;(async () => {
try {
console.log(color(`Started refreshing ${commands.length} application (/) commands.`, "green"))
@@ -35,4 +34,3 @@ for (const file of contentMenuCommands) {
} catch (error) {
console.error(error)
}
})()

View File

@@ -9,19 +9,18 @@ const commandFiles = fs.readdirSync("./src/commands/").filter(file => file.endsW
const contentMenuCommands = fs.readdirSync("./src/commands-contextmenu/").filter(file => file.endsWith(".ts"))
for (const file of commandFiles) {
const command: ICommand = require(`../src/commands/${file}`)
const { default: command } = await import(`../src/commands/${file}`) as { default: ICommand }
if (command.dev) {
commands.push(command.data.toJSON())
}
}
for (const file of contentMenuCommands) {
const command: ICommand = require(`../src/commands-contextmenu/${file}`)
const { default: command } = await import(`../src/commands-contextmenu/${file}`) as { default: ICommand }
if (command.dev) {
commands.push(command.data.toJSON())
}
}
;(async () => {
try {
console.log(`Started refreshing ${commands.length} application (/) commands.`)
@@ -35,4 +34,3 @@ for (const file of contentMenuCommands) {
} catch (error) {
console.error(error)
}
})()

652
yarn.lock

File diff suppressed because it is too large Load Diff