Skip to content

Commit

Permalink
chore: updoots
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfrangu committed Jun 14, 2024
1 parent a2b7ffd commit d859fab
Show file tree
Hide file tree
Showing 8 changed files with 827 additions and 763 deletions.
610 changes: 305 additions & 305 deletions .yarn/releases/yarn-4.2.2.cjs → .yarn/releases/yarn-4.3.0.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: true

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.2.2.cjs
yarnPath: .yarn/releases/yarn-4.3.0.cjs
28 changes: 8 additions & 20 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import process from 'node:process';
import { setup } from '@skyra/env-utilities';
import safeqlPlugin from '@ts-safeql/eslint-plugin';
import safeql from '@ts-safeql/eslint-plugin/config';
import common from 'eslint-config-neon/flat/common.js';
import node from 'eslint-config-neon/flat/node.js';
import prettier from 'eslint-config-neon/flat/prettier.js';
Expand Down Expand Up @@ -39,6 +39,7 @@ const typeScriptRuleset = merge(...typescript, {
'newlines-between': 'never',
},
],
'tsdoc/syntax': 0,
},
settings: {
'import/resolver': {
Expand All @@ -53,31 +54,18 @@ const prettierRuleset = merge(...prettier, { files: [`**/*${commonFiles}`] });

/** @type {import('eslint').Linter.FlatConfig} */
const safeqlRuleset = {
...safeql.configs.connections({
connectionUrl: process.env.POSTGRES_URL,
migrationsDir: './prisma/migrations',
targets: [{ tag: '**prisma.+($queryRaw|$executeRaw)', transform: '{type}[]' }],
overrides: {},
}),
files: [`**/*${commonFiles}`],
plugins: {
safeql: safeqlPlugin,
},
languageOptions: {
parserOptions: {
project: ['tsconfig.eslint.json'],
},
},
rules: {
'safeql/check-sql': [
2,
{
connections: [
{
connectionUrl: process.env.POSTGRES_URL,
migrationsDir: './prisma/migrations',
targets: [
{ tag: '**prisma.+($queryRaw|$executeRaw)', transform: '{type}[]' },
],
},
],
},
],
},
};

/** @type {import('eslint').Linter.FlatConfig[]} */
Expand Down
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,51 +27,51 @@
"watch": "tsc -w"
},
"dependencies": {
"@discordjs/builders": "^1.8.1",
"@discordjs/builders": "^1.8.2",
"@mikro-orm/sql-highlighter": "^1.0.1",
"@prisma/client": "^5.13.0",
"@prisma/client": "^5.15.0",
"@sapphire/decorators": "^6.1.0",
"@sapphire/discord-utilities": "^3.2.3",
"@sapphire/discord.js-utilities": "^7.2.1",
"@sapphire/discord-utilities": "^3.3.0",
"@sapphire/discord.js-utilities": "^7.3.0",
"@sapphire/framework": "^5.2.1",
"@sapphire/plugin-logger": "^4.0.2",
"@sapphire/plugin-subcommands": "^6.0.3",
"@sapphire/stopwatch": "^1.5.2",
"@sapphire/time-utilities": "^1.7.12",
"@sapphire/timestamp": "^1.0.3",
"@sapphire/utilities": "^3.15.3",
"@sapphire/utilities": "^3.16.2",
"@skyra/env-utilities": "^1.3.0",
"@skyra/jaro-winkler": "^1.1.1",
"bufferutil": "^4.0.8",
"colorette": "^2.0.20",
"confusables": "^1.1.1",
"discord-api-types": "0.37.83",
"discord.js": "^14.15.2",
"re2": "^1.20.11",
"tslib": "^2.6.2",
"discord.js": "^14.15.3",
"re2": "^1.21.3",
"tslib": "^2.6.3",
"utf-8-validate": "^6.0.4",
"zlib-sync": "^0.1.9"
},
"devDependencies": {
"@sapphire/prettier-config": "^2.0.0",
"@sapphire/ts-config": "^5.0.1",
"@ts-safeql/eslint-plugin": "^3.1.0",
"@types/is-ci": "^3",
"@ts-safeql/eslint-plugin": "^3.3.1",
"@types/is-ci": "^3.0.4",
"@types/lodash.merge": "^4.6.9",
"@types/node": "^20.12.11",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@types/node": "^20.14.2",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"@vitest/coverage-v8": "^1.6.0",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"is-ci": "^3.0.1",
"libpg-query": "^16.2.0",
"libpg-query": "^15.2.0",
"lodash.merge": "^4.6.2",
"prettier": "^3.2.5",
"prisma": "^5.13.0",
"rimraf": "^5.0.6",
"prettier": "^3.3.2",
"prisma": "^5.15.0",
"rimraf": "^5.0.7",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
},
Expand All @@ -82,9 +82,9 @@
"engines": {
"node": ">=20.0.0"
},
"packageManager": "yarn@4.2.2",
"packageManager": "yarn@4.3.0",
"volta": {
"node": "20.12.2",
"yarn": "4.2.2"
"node": "20.14.0",
"yarn": "4.3.0"
}
}
4 changes: 2 additions & 2 deletions src/lib/utils/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ export interface FullMember extends Member {
export async function getDatabaseMember(guildId: string, userId: string): Promise<FullMember> {
const [_, [rawMember], [rawIgnored]] = await container.prisma.$transaction([
container.prisma.$queryRaw`INSERT INTO users (id) VALUES (${userId}) ON CONFLICT (id) DO NOTHING`,
// eslint-disable-next-line safeql/check-sql
// eslint-disable-next-line @ts-safeql/check-sql
container.prisma.$queryRaw<[RawMember]>`
INSERT INTO members (guild_id, user_id)
VALUES (${guildId}, ${userId})
ON CONFLICT (guild_id, user_id) DO
UPDATE SET user_id = ${userId}
RETURNING *
`,
// eslint-disable-next-line safeql/check-sql
// eslint-disable-next-line @ts-safeql/check-sql
container.prisma.$queryRaw<[RawIgnored]>`
SELECT
array_agg(guild_ignored_channels.ignored_channel_id) as ignored_channels,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/workers/WorkerCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class WorkerCache {
}

case WorkerType.Word: {
const originalSplit = content.toLowerCase().split(/(\s+)/);
const originalSplit = content.toLowerCase().split(/\s+/);

for (const [word, possibleMembers] of guildData.entries()) {
const wordIndex = originalSplit.indexOf(word.toLowerCase());
Expand Down
2 changes: 1 addition & 1 deletion src/listeners/miscEvents/ready.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class ClientReadyListener extends Listener<typeof Events.ClientReady> {
private async ensureAllGuildsAreInDatabase() {
const { prisma, client } = this.container;

// eslint-disable-next-line safeql/check-sql -- This is validated to work but its SO JANK
// eslint-disable-next-line @ts-safeql/check-sql -- This is validated to work but its SO JANK
await prisma.$executeRaw`INSERT INTO guilds (guild_id) VALUES ${Prisma.join(
[...client.guilds.cache.keys()],
'), (',
Expand Down
Loading

0 comments on commit d859fab

Please sign in to comment.