Skip to content

Commit

Permalink
Upgrade some deps (#5870)
Browse files Browse the repository at this point in the history
  • Loading branch information
gc authored May 4, 2024
1 parent 44a3950 commit 07973ca
Show file tree
Hide file tree
Showing 37 changed files with 793 additions and 1,005 deletions.
39 changes: 19 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
{
"scripts": {
"gen": "concurrently \"prisma generate\" \"prisma generate --schema prisma/robochimp.prisma\" && echo \"Generated Prisma Client\"",
"lint": "concurrently \"prettier --use-tabs ./**/*.{js,md,json,yml} --write\" \"eslint *.ts \"{src,tests}/**/*.ts\" --fix\"",
"lint": "concurrently \"prettier --use-tabs ./**/*.{js,md,json,yml} --write\" \"eslint *.{ts,mts} \"{src,tests}/**/*.ts\" --fix\"",
"build:tsc": "tsc -p src",
"build": "concurrently \"yarn wipedist\" \"yarn gen\" && concurrently \"yarn prebuild:scripts\" && yarn build:tsc && echo \"Finished Building\"",
"wipedist": "rimraf \"dist/\"",
"start": "yarn build && concurrently \"tsc -w -p src\" \"node dist/\"",
"start": "yarn build && concurrently \"tsc -w -p src\" \"node --enable-source-maps dist/\"",
"test": "concurrently \"tsc -p src\" \"yarn test:lint\" \"yarn test:unit\"",
"test:lint": "eslint --quiet *.ts \"{src,tests}/**/*.ts\"",
"test:unit": "vitest run --coverage --config vitest.unit.config.ts",
"test:lint": "eslint --quiet *.{mts,ts} \"{src,tests}/**/*.ts\"",
"test:unit": "vitest run --coverage --config vitest.unit.config.mts",
"dev": "yarn wipedist && tsc -w -p src",
"test:watch": "vitest --config vitest.unit.config.ts --coverage",
"test:watch": "vitest --config vitest.unit.config.mts --coverage",
"test:integration": "tsx ./src/scripts/integration-tests.ts",
"prebuild:scripts": "tsx ./src/scripts/render-creatables-file.ts",
"build:esbuild": "esbuild --bundle src/index.ts --outdir=dist --platform=node --loader:.node=file --external:canvas"
"build:esbuild": "esbuild --bundle src/index.ts --outdir=dist --platform=node --loader:.node=file --external:canvas",
"run:node": "node --enable-source-maps dist/index.js"
},
"dependencies": {
"@discordjs/builders": "^1.5.0",
"@fastify/cors": "^8.2.0",
"@fastify/helmet": "^10.1.0",
"@fastify/rate-limit": "^8.0.0",
"@fastify/sensible": "^5.2.0",
"@napi-rs/canvas": "0.1.38",
"@octokit/graphql": "^4.8.0",
"@oldschoolgg/toolkit": "^0.0.24",
"@prisma/client": "^5.10.2",
"@prisma/client": "^5.13.0",
"@sapphire/snowflake": "^3.5.3",
"@sapphire/stopwatch": "^1.4.0",
"@sapphire/time-utilities": "^1.6.0",
"@sentry/node": "^7.102.0",
"@sentry/node": "^7.113.0",
"ascii-table3": "^0.9.0",
"bufferutil": "^4.0.8",
"chart.js": "^3.7.0",
"chartjs-node-canvas": "github:gc/ChartjsNodeCanvas#a598b6dd27c44351f235bca07ca4ee660121f289",
"chartjs-plugin-datalabels": "^2.0.0",
"deep-equal": "^2.2.3",
"deepmerge": "^4.3.1",
"discord.js": "^14.13.0",
"discord.js": "^14.14.1",
"dotenv": "^16.0.3",
"e": "^0.2.33",
"fastify": "^4.14.1",
Expand All @@ -50,13 +50,13 @@
"node-fetch": "^2.6.7",
"oldschooljs": "^2.5.1",
"p-queue": "^6.6.2",
"piscina": "^4.3.2",
"piscina": "^4.4.0",
"random-js": "^2.1.0",
"simple-statistics": "^7.8.3",
"sonic-boom": "^3.8.0",
"tsx": "^4.7.1",
"sonic-boom": "^4.0.1",
"tsx": "^4.9.0",
"zlib-sync": "^0.1.9",
"zod": "^3.22.4"
"zod": "^3.23.6"
},
"devDependencies": {
"@oldschoolgg/eslint-config": "^2.0.13",
Expand All @@ -74,21 +74,20 @@
"@vitest/coverage-v8": "^1.3.1",
"concurrently": "^7.6.0",
"dotenv-cli": "^7.3.0",
"esbuild": "^0.19.5",
"esbuild": "^0.20.2",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^8.0.0",
"eslint-plugin-unicorn": "^44.0.2",
"jest-image-snapshot": "^6.2.0",
"madge": "^6.0.0",
"madge": "^7.0.0",
"prettier": "^2.7.1",
"prisma": "^5.10.2",
"rimraf": "^4.4.0",
"source-map-support": "^0.5.21",
"prisma": "^5.13.0",
"rimraf": "^5.0.5",
"typescript": "5.0.2",
"vitest": "^1.3.1"
"vitest": "^1.6.0"
},
"engines": {
"node": ">=18.12.0"
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'source-map-support/register';
import './lib/data/itemAliases';
import './lib/crons';
import './lib/MUser';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/MUser.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { userMention } from '@discordjs/builders';
import { UserError } from '@oldschoolgg/toolkit/dist/lib/UserError';
import { GearSetupType, Prisma, User, UserStats, xp_gains_skill_enum } from '@prisma/client';
import { userMention } from 'discord.js';
import { calcWhatPercent, objectEntries, percentChance, sumArr, uniqueArr } from 'e';
import { Bank } from 'oldschooljs';
import { EquipmentSlot, Item } from 'oldschooljs/dist/meta/types';
Expand Down
3 changes: 1 addition & 2 deletions src/lib/events.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { EmbedBuilder } from '@discordjs/builders';
import { mentionCommand } from '@oldschoolgg/toolkit';
import { UserError } from '@oldschoolgg/toolkit/dist/lib/UserError';
import { BaseMessageOptions, bold, ButtonBuilder, ButtonStyle, Message, TextChannel } from 'discord.js';
import { BaseMessageOptions, bold, ButtonBuilder, ButtonStyle, EmbedBuilder, Message, TextChannel } from 'discord.js';
import { isFunction, roll, Time } from 'e';
import LRUCache from 'lru-cache';
import { Items } from 'oldschooljs';
Expand Down
3 changes: 1 addition & 2 deletions src/lib/party.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable prefer-promise-reject-errors */
import { userMention } from '@discordjs/builders';
import { UserError } from '@oldschoolgg/toolkit/dist/lib/UserError';
import { ButtonBuilder, ButtonStyle, ComponentType, InteractionCollector, TextChannel } from 'discord.js';
import { ButtonBuilder, ButtonStyle, ComponentType, InteractionCollector, TextChannel, userMention } from 'discord.js';
import { debounce, noOp, Time } from 'e';

import { production } from '../config';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/simulation/TeamLoot.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { spoiler, userMention } from '@discordjs/builders';
import { spoiler, userMention } from 'discord.js';
import { Bank } from 'oldschooljs';

import { Emoji } from '../constants';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/simulation/nex.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { userMention } from '@discordjs/builders';
import { userMention } from 'discord.js';
import {
calcWhatPercent,
clamp,
Expand Down
3 changes: 1 addition & 2 deletions src/lib/tickers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { EmbedBuilder } from '@discordjs/builders';
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, TextChannel } from 'discord.js';
import { ActionRowBuilder, ButtonBuilder, ButtonStyle, EmbedBuilder, TextChannel } from 'discord.js';
import { noOp, randInt, removeFromArr, shuffleArr, Time } from 'e';

import { production } from '../config';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/util/statsEmbed.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EmbedBuilder } from '@discordjs/builders';
import { toTitleCase } from '@oldschoolgg/toolkit';
import { EmbedBuilder } from 'discord.js';
import { Player } from 'oldschooljs';
import { CluesScore, SkillScore, SkillsScore } from 'oldschooljs/dist/meta/types';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/util/webhook.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { EmbedBuilder } from '@discordjs/builders';
import { splitMessage } from '@oldschoolgg/toolkit';
import {
AttachmentBuilder,
BaseMessageOptions,
EmbedBuilder,
Message,
PartialGroupDMChannel,
PermissionsBitField,
Expand Down
3 changes: 1 addition & 2 deletions src/mahoji/commands/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import { execSync } from 'node:child_process';
import { inspect } from 'node:util';

import { codeBlock } from '@discordjs/builders';
import { ClientStorage, economy_transaction_type } from '@prisma/client';
import { Stopwatch } from '@sapphire/stopwatch';
import { isThenable } from '@sentry/utils';
import { AttachmentBuilder, escapeCodeBlock, InteractionReplyOptions } from 'discord.js';
import { AttachmentBuilder, codeBlock, escapeCodeBlock, InteractionReplyOptions } from 'discord.js';
import { calcWhatPercent, noOp, notEmpty, randArrItem, sleep, Time, uniqueArr } from 'e';
import { ApplicationCommandOptionType, CommandRunOptions } from 'mahoji';
import { CommandResponse } from 'mahoji/dist/lib/structures/ICommand';
Expand Down
2 changes: 1 addition & 1 deletion src/mahoji/commands/bank.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { codeBlock, EmbedBuilder } from '@discordjs/builders';
import { codeBlock, EmbedBuilder } from 'discord.js';
import { chunk } from 'e';
import { ApplicationCommandOptionType, CommandRunOptions } from 'mahoji';
import { Bank } from 'oldschooljs';
Expand Down
3 changes: 1 addition & 2 deletions src/mahoji/commands/bingo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { userMention } from '@discordjs/builders';
import { formatOrdinal, mentionCommand, stringMatches, truncateString } from '@oldschoolgg/toolkit';
import { Prisma } from '@prisma/client';
import { bold, ChatInputCommandInteraction, User } from 'discord.js';
import { bold, ChatInputCommandInteraction, User, userMention } from 'discord.js';
import { chunk, noOp, notEmpty, Time, uniqueArr } from 'e';
import { ApplicationCommandOptionType, CommandRunOptions } from 'mahoji';
import { CommandResponse } from 'mahoji/dist/lib/structures/ICommand';
Expand Down
3 changes: 1 addition & 2 deletions src/mahoji/commands/bossrecords.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { EmbedBuilder } from '@discordjs/builders';
import { toTitleCase } from '@oldschoolgg/toolkit';
import { MessageEditOptions } from 'discord.js';
import { EmbedBuilder, MessageEditOptions } from 'discord.js';
import { chunk } from 'e';
import { ApplicationCommandOptionType, CommandRunOptions } from 'mahoji';
import { Hiscores } from 'oldschooljs';
Expand Down
2 changes: 1 addition & 1 deletion src/mahoji/commands/clues.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EmbedBuilder } from '@discordjs/builders';
import { toTitleCase } from '@oldschoolgg/toolkit';
import { EmbedBuilder } from 'discord.js';
import { ApplicationCommandOptionType, CommandRunOptions } from 'mahoji';
import { Hiscores } from 'oldschooljs';

Expand Down
12 changes: 10 additions & 2 deletions src/mahoji/commands/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import { EmbedBuilder, inlineCode } from '@discordjs/builders';
import { hasBanMemberPerms, miniID } from '@oldschoolgg/toolkit';
import { activity_type_enum } from '@prisma/client';
import { bold, ChatInputCommandInteraction, Guild, HexColorString, resolveColor, User } from 'discord.js';
import {
bold,
ChatInputCommandInteraction,
EmbedBuilder,
Guild,
HexColorString,
inlineCode,
resolveColor,
User
} from 'discord.js';
import { clamp, removeFromArr, Time, uniqueArr } from 'e';
import { ApplicationCommandOptionType, CommandRunOptions } from 'mahoji';
import { CommandResponse } from 'mahoji/dist/lib/structures/ICommand';
Expand Down
3 changes: 1 addition & 2 deletions src/mahoji/commands/leaderboard.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { EmbedBuilder } from '@discordjs/builders';
import { toTitleCase } from '@oldschoolgg/toolkit';
import { Prisma } from '@prisma/client';
import { ChatInputCommandInteraction } from 'discord.js';
import { ChatInputCommandInteraction, EmbedBuilder } from 'discord.js';
import { calcWhatPercent, chunk, objectValues, Time } from 'e';
import { ApplicationCommandOptionType, CommandRunOptions } from 'mahoji';

Expand Down
2 changes: 1 addition & 1 deletion src/mahoji/commands/price.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EmbedBuilder } from '@discordjs/builders';
import { EmbedBuilder } from 'discord.js';
import { CommandRunOptions } from 'mahoji';
import { toKMB } from 'oldschooljs/dist/util';

Expand Down
2 changes: 1 addition & 1 deletion src/mahoji/commands/redeem.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { bold } from '@discordjs/builders';
import { ProductID, products } from '@oldschoolgg/toolkit';
import { bold } from 'discord.js';
import { notEmpty } from 'e';
import { ApplicationCommandOptionType, CommandRunOptions } from 'mahoji';

Expand Down
3 changes: 1 addition & 2 deletions src/mahoji/commands/rp.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { codeBlock } from '@discordjs/builders';
import { toTitleCase } from '@oldschoolgg/toolkit';
import { UserEventType, xp_gains_skill_enum } from '@prisma/client';
import { DiscordSnowflake } from '@sapphire/snowflake';
import { Duration } from '@sapphire/time-utilities';
import { SnowflakeUtil } from 'discord.js';
import { codeBlock, SnowflakeUtil } from 'discord.js';
import { randArrItem, sumArr, Time } from 'e';
import { ApplicationCommandOptionType, CommandRunOptions } from 'mahoji';
import { MahojiUserOption } from 'mahoji/dist/lib/types';
Expand Down
3 changes: 1 addition & 2 deletions src/mahoji/commands/tools.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { EmbedBuilder } from '@discordjs/builders';
import { Activity, User } from '@prisma/client';
import { ChannelType } from 'discord.js';
import { ChannelType, EmbedBuilder } from 'discord.js';
import { ApplicationCommandOptionType, CommandRunOptions } from 'mahoji';
import { CommandResponse } from 'mahoji/dist/lib/structures/ICommand';
import { Bank } from 'oldschooljs';
Expand Down
3 changes: 1 addition & 2 deletions src/mahoji/commands/trivia.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { userMention } from '@discordjs/builders';
import { TextChannel } from 'discord.js';
import { TextChannel, userMention } from 'discord.js';
import { shuffleArr, uniqueArr } from 'e';
import { ApplicationCommandOptionType } from 'mahoji';
import { CommandRunOptions, MahojiUserOption } from 'mahoji/dist/lib/types';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { strikethrough } from '@discordjs/builders';
import { toTitleCase } from '@oldschoolgg/toolkit';
import { strikethrough } from 'discord.js';
import { calcWhatPercent } from 'e';
import { Bank, Monsters } from 'oldschooljs';

Expand Down
2 changes: 1 addition & 1 deletion src/mahoji/lib/abstracted_commands/birdhousesCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { time } from '@discordjs/builders';
import { User } from '@prisma/client';
import { time } from 'discord.js';
import { Bank } from 'oldschooljs';

import birdhouses, { Birdhouse, birdhouseSeeds } from '../../../lib/skilling/skills/hunter/birdHouseTrapping';
Expand Down
3 changes: 1 addition & 2 deletions src/mahoji/lib/abstracted_commands/hotColdCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { EmbedBuilder } from '@discordjs/builders';
import { ChatInputCommandInteraction } from 'discord.js';
import { ChatInputCommandInteraction, EmbedBuilder } from 'discord.js';
import { CommandResponse } from 'mahoji/dist/lib/structures/ICommand';
import { LootTable } from 'oldschooljs';
import { toKMB } from 'oldschooljs/dist/util';
Expand Down
3 changes: 1 addition & 2 deletions src/mahoji/lib/abstracted_commands/nexCommand.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { userMention } from '@discordjs/builders';
import { ChannelType, ChatInputCommandInteraction, TextChannel } from 'discord.js';
import { ChannelType, ChatInputCommandInteraction, TextChannel, userMention } from 'discord.js';
import { Bank } from 'oldschooljs';

import { trackLoot } from '../../../lib/lootTrack';
Expand Down
2 changes: 0 additions & 2 deletions src/mahoji/lib/abstracted_commands/slayerTaskCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ async function returnSuccess(channelID: string, user: MUser, content: string) {
interaction: selection,
...options
});
return;
}
}
} catch (err: unknown) {
Expand Down Expand Up @@ -470,7 +469,6 @@ export async function slayerSkipTaskCommand({
});
}
interactionReply(interaction, resultMessage);
return;
} catch (e) {
logError(e, {
user_id: user.id.toString(),
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/integration-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function main() {
let runs = 1;
for (let i = 0; i < runs; i++) {
console.log(`Starting run ${i + 1}/${runs}`);
execSync('vitest run --config vitest.integration.config.ts', {
execSync('vitest run --config vitest.integration.config.mts', {
stdio: 'inherit',
encoding: 'utf-8'
});
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/minions/nexActivity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { userMention } from '@discordjs/builders';
import { formatOrdinal } from '@oldschoolgg/toolkit';
import { userMention } from 'discord.js';

import { NEX_ID } from '../../lib/constants';
import { trackLoot } from '../../lib/lootTrack';
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/grandExchange.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'source-map-support/register';

import { calcPercentOfNum, randArrItem, randInt, shuffleArr, Time } from 'e';
import { Bank } from 'oldschooljs';
import PQueue from 'p-queue';
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/tradeTransaction.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'source-map-support/register';

import { Prisma } from '@prisma/client';
import { Bank } from 'oldschooljs';
import { describe, expect, test } from 'vitest';
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.eslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
"allowJs": true,
"checkJs": true
},
"include": ["src", "tests", "*.ts"]
"include": ["src", "tests", "*.ts", "*.mts"]
}
20 changes: 20 additions & 0 deletions vitest.integration.config.mts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
name: 'Old School Bot - Integration',
include: ['tests/integration/**/*.test.ts'],
setupFiles: 'tests/integration/setup.ts',
coverage: {
provider: 'v8',
reporter: 'text',
include: ['src/lib/MUser.ts']
},
testTimeout: 30_000,
bail: 1,
maxConcurrency: 1,
maxWorkers: 1,
minWorkers: 1,
pool: 'forks'
}
});
20 changes: 0 additions & 20 deletions vitest.integration.config.ts

This file was deleted.

Loading

0 comments on commit 07973ca

Please sign in to comment.