Skip to content

Commit

Permalink
chore: big ol' dependency update (#738)
Browse files Browse the repository at this point in the history
* chore: update dependencies

* chore: update node

* chore: use it instead of test

* feat: last lint issues
  • Loading branch information
naomi-lgbt authored Dec 9, 2024
1 parent 7f535bd commit a1cc3b1
Show file tree
Hide file tree
Showing 92 changed files with 1,666 additions and 835 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [22.x]

steps:
- name: Checkout Source Files
Expand Down
5 changes: 4 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export default [
{
files: ["test/**/*.spec.ts"],
rules: {
"@typescript-eslint/consistent-type-assertions": "off"
"@typescript-eslint/consistent-type-assertions": "off",
"max-nested-callbacks": "off",
// TODO: migrate the tests and turn these on...
"vitest/prefer-expect-assertions": "off",
}
}
];
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"db:deploy": "prisma db push"
},
"engines": {
"node": "20",
"pnpm": "9"
"node": ">=22",
"pnpm": ">=9"
},
"license": "MIT",
"dependencies": {
"@prisma/client": "5.22.0",
"@prisma/client": "6.0.1",
"@tryghost/admin-api": "1.13.12",
"deepl-node": "1.15.0",
"diff": "7.0.0",
Expand All @@ -41,16 +41,16 @@
"winston": "3.17.0"
},
"devDependencies": {
"@nhcarrigan/eslint-config": "4.0.0",
"@nhcarrigan/eslint-config": "5.0.0",
"@nhcarrigan/typescript-config": "4.0.0",
"@types/diff": "6.0.0",
"@types/node": "22.9.0",
"@types/node": "22.10.1",
"@types/node-schedule": "2.1.7",
"@types/string-similarity": "4.0.2",
"@vitest/coverage-istanbul": "2.1.8",
"discordjs-testing": "0.2.0",
"eslint": "9.14.0",
"prisma": "5.22.0",
"eslint": "9.16.0",
"prisma": "6.0.1",
"rimraf": "6.0.1",
"tsx": "4.19.2",
"typescript": "5.7.2",
Expand Down
1,777 changes: 1,304 additions & 473 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/modules/formatter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { format, type Options } from "prettier";
// eslint-disable-next-line import/default, import/no-named-as-default, import/no-named-as-default-member
import stripAnsi from "strip-ansi";

/**
Expand Down
37 changes: 19 additions & 18 deletions src/modules/generateProfileImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ const generateProfileImage = async(
}
body {
background: url(${backgroundImage === ""
? `https://cdn.freecodecamp.org/platform/universal/fcc_meta_1920X1080-indigo.png"`
: backgroundImage}) no-repeat center center fixed;
? `https://cdn.freecodecamp.org/platform/universal/fcc_meta_1920X1080-indigo.png"`
: backgroundImage}) no-repeat center center fixed;
background-size: cover;
width: 1920px;
height: 1080px;
Expand All @@ -213,11 +213,11 @@ const generateProfileImage = async(
width: 100%;
height: 100%;
background-color: #${backgroundColour === ""
? "0a0a23"
: backgroundColour}bf;
? "0a0a23"
: backgroundColour}bf;
color: #${colour === ""
? "d0d0d5"
: colour};
? "d0d0d5"
: colour};
padding: 2.5%;
border-radius: 100px;
}
Expand Down Expand Up @@ -267,8 +267,8 @@ const generateProfileImage = async(
<main>
<div class="header">
<img class="avatar" src=${avatar === ""
? "https://cdn.freecodecamp.org/platform/universal/fcc_puck_500.jpg"
: avatar}></img>
? "https://cdn.freecodecamp.org/platform/universal/fcc_puck_500.jpg"
: avatar}></img>
<div>
<h1>${userTag}</h1>
<p>Level ${String(level)} (${points.toLocaleString("en-GB")}xp)</p>
Expand Down Expand Up @@ -363,22 +363,23 @@ const generateLeaderboardImage = async(
</style>
<body>
${levels.map(
(l) => {
return `<div class="row" style="background-color: #${l.backgroundColour === ""
? "0a0a23"
: l.backgroundColour}bf;color: #${l.colour === ""
? "d0d0d5"
: l.colour};padding: 2.5%;border-radius: 100px;">
(l) => {
return `<div class="row" style="background-color: #${l.backgroundColour === ""
? "0a0a23"
: l.backgroundColour}bf;color: #${l.colour === ""
? "d0d0d5"
: l.colour};padding: 2.5%;border-radius: 100px;">
<img style="border-radius: 50%;" src=${l.avatar === ""
? "https://cdn.freecodecamp.org/platform/universal/fcc_puck_500.jpg"
: l.avatar}></img>
// eslint-disable-next-line stylistic/max-len
? "https://cdn.freecodecamp.org/platform/universal/fcc_puck_500.jpg"
: l.avatar}></img>
<div style="text-align: left;padding-left:100px;">
<h1>#${String(l.index)}. ${l.userTag}</h1>
<p>Level ${String(l.level)} (${String(l.points)}xp)</p>
</div>
</div>`;
},
).join(", ")}
},
).join(", ")}
</body>
`;
const alt = levels.
Expand Down
1 change: 0 additions & 1 deletion src/server/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import { createHmac, timingSafeEqual } from "node:crypto";
import { readFile } from "node:fs/promises";
import { WebhookClient } from "discord.js";
// eslint-disable-next-line import/default, import/no-named-as-default, import/no-named-as-default-member
import fastify from "fastify";
import { errorHandler } from "../utils/errorHandler.js";
import type { ExtendedClient } from "../interfaces/extendedClient.js";
Expand Down
4 changes: 2 additions & 2 deletions test/commands/author.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, assert, test } from "vitest";
import { describe, assert, it } from "vitest";
import { author } from "../../src/commands/author.js";

describe("author command", () => {
test("is defined", () => {
it("is defined", () => {
assert.isDefined(author);
});
});
18 changes: 9 additions & 9 deletions test/commands/community.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ApplicationCommandOptionType,
type SlashCommandSubcommandBuilder,
} from "discord.js";
import { describe, assert, test } from "vitest";
import { describe, assert, it } from "vitest";
import { community } from "../../src/commands/community.js";

describe("community command", () => {
Expand All @@ -12,7 +12,7 @@ describe("community command", () => {
},
) as Array<SlashCommandSubcommandBuilder>;

test("has correct data", () => {
it("has correct data", () => {
assert.strictEqual(community.data.name, "community");
assert.strictEqual(
community.data.description,
Expand All @@ -21,7 +21,7 @@ describe("community command", () => {
assert.lengthOf(subcommands, 7);
});

test("has correct code of conduct", () => {
it("has correct code of conduct", () => {
const codeOfConduct = subcommands.find(
(sub) => {
return sub.name === "code-of-conduct";
Expand All @@ -36,7 +36,7 @@ describe("community command", () => {
assert.lengthOf(codeOfConduct?.options || "hi", 0);
});

test("has correct contribute", () => {
it("has correct contribute", () => {
const contribute = subcommands.find((sub) => {
return sub.name === "contribute";
});
Expand All @@ -49,7 +49,7 @@ describe("community command", () => {
assert.lengthOf(contribute?.options || "hi", 0);
});

test("has correct forum", () => {
it("has correct forum", () => {
const forum = subcommands.find((sub) => {
return sub.name === "forum";
});
Expand All @@ -62,7 +62,7 @@ describe("community command", () => {
assert.lengthOf(forum?.options || "hi", 0);
});

test("has correct leaderboard", () => {
it("has correct leaderboard", () => {
const leaderboard = subcommands.find((sub) => {
return sub.name === "leaderboard";
});
Expand All @@ -72,7 +72,7 @@ describe("community command", () => {
assert.lengthOf(leaderboard?.options || "hi", 0);
});

test("has correct quote", () => {
it("has correct quote", () => {
const quote = subcommands.find((sub) => {
return sub.name === "quote";
});
Expand All @@ -82,7 +82,7 @@ describe("community command", () => {
assert.lengthOf(quote?.options || "hi", 0);
});

test("has correct profile", () => {
it("has correct profile", () => {
const rank = subcommands.find((sub) => {
return sub.name === "profile";
});
Expand All @@ -91,7 +91,7 @@ describe("community command", () => {
assert.lengthOf(rank?.options || "hi", 0);
});

test("has correct truism", () => {
it("has correct truism", () => {
const truism = subcommands.find((sub) => {
return sub.name === "truism";
});
Expand Down
12 changes: 6 additions & 6 deletions test/commands/github.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ApplicationCommandOptionType,
type SlashCommandSubcommandBuilder,
} from "discord.js";
import { describe, assert, test } from "vitest";
import { describe, assert, it } from "vitest";
import { github } from "../../src/commands/github.js";

describe("github command", () => {
Expand All @@ -12,7 +12,7 @@ describe("github command", () => {
},
) as Array<SlashCommandSubcommandBuilder>;

test("has correct data", () => {
it("has correct data", () => {
assert.strictEqual(github.data.name, "github");
assert.strictEqual(
github.data.description,
Expand All @@ -21,7 +21,7 @@ describe("github command", () => {
assert.lengthOf(subcommands, 4);
});

test("has correct close", () => {
it("has correct close", () => {
const close = subcommands.find((sub) => {
return sub.name === "close";
});
Expand Down Expand Up @@ -74,7 +74,7 @@ describe("github command", () => {
);
});

test("has correct comment", () => {
it("has correct comment", () => {
const comment = subcommands.find((sub) => {
return sub.name === "comment";
});
Expand Down Expand Up @@ -117,7 +117,7 @@ describe("github command", () => {
);
});

test("has correct add labels", () => {
it("has correct add labels", () => {
const command = subcommands.find((sub) => {
return sub.name === "add-labels";
});
Expand Down Expand Up @@ -160,7 +160,7 @@ describe("github command", () => {
);
});

test("has correct sync labels", () => {
it("has correct sync labels", () => {
const command = subcommands.find((sub) => {
return sub.name === "sync-labels";
});
Expand Down
8 changes: 4 additions & 4 deletions test/commands/management.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ApplicationCommandOptionType,
type SlashCommandSubcommandBuilder,
} from "discord.js";
import { describe, assert, test } from "vitest";
import { describe, assert, it } from "vitest";
import { management } from "../../src/commands/management.js";

describe("management command", () => {
Expand All @@ -12,7 +12,7 @@ describe("management command", () => {
},
) as Array<SlashCommandSubcommandBuilder>;

test("has correct data", () => {
it("has correct data", () => {
assert.strictEqual(management.data.name, "management");
assert.strictEqual(
management.data.description,
Expand All @@ -21,7 +21,7 @@ describe("management command", () => {
assert.lengthOf(subcommands, 3);
});

test("has correct private", () => {
it("has correct private", () => {
const privateC = subcommands.find((sub) => {
return sub.name === "private";
});
Expand All @@ -42,7 +42,7 @@ describe("management command", () => {
);
});

test("has correct role", () => {
it("has correct role", () => {
const role = subcommands.find((sub) => {
return sub.name === "role";
});
Expand Down
Loading

0 comments on commit a1cc3b1

Please sign in to comment.