Skip to content

Commit 89f7ae2

Browse files
authored
Upgrade to react-router@7, eslint@9, version bump the rest (#101)
Goal here is to get fully up-to-date with modern Remix/React Router. I've gotten this working ~ correctly (as best I can tell right now) with hot reloading for server/Remix/client (which are different things! the Express server and Remix SSR are built separately, it's a PITA). This is a draft PR while I continue working on moving to React Router v7 (from Remix v2).
1 parent 954d75e commit 89f7ae2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+12073
-33492
lines changed

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ yarn.lock
1010
*.log
1111
k8s-context
1212
*.sqlite3
13-
/cypress/screenshots
14-
/cypress/videos
1513
tsconfig.tsbuildinfo
14+
.react-router

.husky/pre-push

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
31

42
npm run validate

.lintstagedrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = {
1+
export default {
22
"**/*.[tj]s?(x)": ["eslint --fix --max-warnings=0", "prettier --check"],
33
"migrations/*.[tj]s": [
44
"npm run start:migrate",

Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /app
44
COPY package.json package-lock.json ./
55
RUN npm install
66

7-
COPY remix.config.js tailwind.config.js kysely.config.ts tsconfig.json .eslint* .prettierignore ./
7+
COPY vite.config.ts tailwind.config.js kysely.config.ts tsconfig.json .eslint* .prettierignore ./
88
COPY app ./app
99

1010
RUN npm run build
@@ -20,7 +20,6 @@ ADD package.json package-lock.json ./
2020
RUN npm prune --production
2121

2222
COPY --from=build /app/build ./build
23-
COPY --from=build /app/public ./public
2423

2524
COPY kysely.config.ts ./
2625
COPY migrations ./migrations

app/commands/convene.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const handler = async (
8282
staff,
8383
extra: "✅ Restricted",
8484
}),
85-
applyRestriction(message.member!),
85+
applyRestriction(message.member),
8686
message.reply(
8787
"After a vote by the mods, this member has had restrictions applied to them",
8888
),
@@ -96,7 +96,7 @@ export const handler = async (
9696
staff,
9797
extra: "✅ Kicked",
9898
}),
99-
kick(message.member!),
99+
kick(message.member),
100100
message.reply(
101101
"After a vote by the mods, this member has been kicked from the server to cool off",
102102
),
@@ -110,13 +110,13 @@ export const handler = async (
110110
staff,
111111
extra: "✅ Banned",
112112
}),
113-
ban(message.member!),
113+
ban(message.member),
114114
message.reply(
115115
"After a vote by the mods, this member has been permanently banned",
116116
),
117117
]);
118118
return;
119-
case resolutions.nudge:
119+
case resolutions.nudge: {
120120
const [thread] = await Promise.all([
121121
originalChannel.threads.create({
122122
name: message.author.username,
@@ -145,6 +145,7 @@ This isn't a formal warning, but your message concerned the moderators enough th
145145
146146
${quoteAndEscape(message.content)}`);
147147
return;
148+
}
148149
case resolutions.warning:
149150
reportUser({
150151
reason: ReportReasons.mod,
@@ -172,7 +173,7 @@ This isn't a formal warning, but your message concerned the moderators enough th
172173
staff,
173174
extra: "✅ Timed out overnight",
174175
});
175-
timeout(message.member!);
176+
timeout(message.member);
176177

177178
return;
178179
}

app/commands/reacord/ModResponse.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { UserInfo } from "reacord";
1+
import type { ComponentEventUser } from "reacord";
22
import { Button } from "reacord";
33

44
import type { Resolution } from "~/helpers/modResponse";
@@ -17,7 +17,7 @@ export const ModResponse = ({
1717
modRoleId,
1818
}: {
1919
votesRequired?: number;
20-
onVote: (result: { vote: Resolution; user: UserInfo }) => void;
20+
onVote: (result: { vote: Resolution; user: ComponentEventUser }) => void;
2121
onResolve: (result: Resolution) => Promise<void>;
2222
modRoleId: string;
2323
}) => {

app/commands/setupTickets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
import { REST } from "@discordjs/rest";
1616
import { Routes, TextInputStyle } from "discord-api-types/v10";
1717

18-
import { discordToken } from "~/helpers/env";
18+
import { discordToken } from "~/helpers/env.server";
1919
import { SETTINGS, fetchSettings } from "~/models/guilds.server";
2020
import { format } from "date-fns";
2121
import type {
@@ -114,7 +114,7 @@ export default [
114114
await thread.send({
115115
content: "When you’ve finished, please close the ticket.",
116116
components: [
117-
// @ts-ignore
117+
// @ts-expect-error Types for this are super busted
118118
new ActionRowBuilder().addComponents(
119119
new ButtonBuilder()
120120
.setCustomId(`close-ticket||${user.id}`)

app/components/login.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Form } from "@remix-run/react";
1+
import { Form } from "react-router";
22
import type { ButtonHTMLAttributes } from "react";
33

44
interface LoginProps extends ButtonHTMLAttributes<Element> {
@@ -8,7 +8,7 @@ interface LoginProps extends ButtonHTMLAttributes<Element> {
88

99
export function Login({
1010
children = "Log in with Discord",
11-
errors,
11+
// errors,
1212
redirectTo,
1313
...props
1414
}: LoginProps) {

0 commit comments

Comments
 (0)