upgrade to remix 1.14

This commit is contained in:
m5r 2023-04-29 07:36:22 +02:00
parent f392bd8af0
commit aee8ded63a
6 changed files with 6407 additions and 7303 deletions

View File

@ -5,7 +5,7 @@ import Button from "../button";
import SettingsSection from "../settings-section"; import SettingsSection from "../settings-section";
import Alert from "~/features/core/components/alert"; import Alert from "~/features/core/components/alert";
import useSession from "~/features/core/hooks/use-session"; import useSession from "~/features/core/hooks/use-session";
import type { PhoneSettingsLoaderData } from "~/features/settings/loaders/phone"; import type loader from "~/features/settings/loaders/phone";
import type { SetPhoneNumberActionData } from "~/features/settings/actions/phone"; import type { SetPhoneNumberActionData } from "~/features/settings/actions/phone";
import clsx from "clsx"; import clsx from "clsx";
@ -13,8 +13,8 @@ export default function PhoneNumberForm() {
const { twilio } = useSession(); const { twilio } = useSession();
const fetcher = useFetcher(); const fetcher = useFetcher();
const transition = useTransition(); const transition = useTransition();
const actionData = useActionData<SetPhoneNumberActionData>()?.setPhoneNumber; const actionData = useActionData<any>()?.setPhoneNumber;
const availablePhoneNumbers = useLoaderData<PhoneSettingsLoaderData>().phoneNumbers; const availablePhoneNumbers = useLoaderData<typeof loader>().phoneNumbers;
const actionSubmitted = transition.submission?.formData.get("_action"); const actionSubmitted = transition.submission?.formData.get("_action");
const isCurrentFormTransition = const isCurrentFormTransition =

View File

@ -1,4 +1,4 @@
import { type LoaderFunction, json } from "@remix-run/node"; import { type LoaderArgs, json } from "@remix-run/node";
import { type PhoneNumber, Prisma } from "@prisma/client"; import { type PhoneNumber, Prisma } from "@prisma/client";
import db from "~/utils/db.server"; import db from "~/utils/db.server";
@ -12,11 +12,11 @@ export type PhoneSettingsLoaderData = {
phoneNumbers: Pick<PhoneNumber, "id" | "number" | "isCurrent">[]; phoneNumbers: Pick<PhoneNumber, "id" | "number" | "isCurrent">[];
}; };
const loader: LoaderFunction = async ({ request }) => { const loader = async ({ request }: LoaderArgs) => {
const { organization, twilio } = await requireLoggedIn(request); const { organization, twilio } = await requireLoggedIn(request);
if (!twilio) { if (!twilio) {
logger.warn("Twilio account is not connected"); logger.warn("Twilio account is not connected");
return json<PhoneSettingsLoaderData>({ phoneNumbers: [] }); return json({ phoneNumbers: [] });
} }
const phoneNumbers = await db.phoneNumber.findMany({ const phoneNumbers = await db.phoneNumber.findMany({
@ -25,7 +25,7 @@ const loader: LoaderFunction = async ({ request }) => {
orderBy: { id: Prisma.SortOrder.desc }, orderBy: { id: Prisma.SortOrder.desc },
}); });
return json<PhoneSettingsLoaderData>({ return json({
accountSid: twilio.accountSid, accountSid: twilio.accountSid,
authToken: decrypt(twilio.authToken), authToken: decrypt(twilio.authToken),
phoneNumbers, phoneNumbers,

View File

@ -1,4 +1,4 @@
import type { AssetsManifest } from "@remix-run/react/entry"; import type { AssetsManifest } from "@remix-run/react/dist/entry";
declare const ASSET_CACHE: string; declare const ASSET_CACHE: string;
declare const self: ServiceWorkerGlobalScope; declare const self: ServiceWorkerGlobalScope;

13678
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -32,9 +32,9 @@
"@maizzle/framework": "3.7.3", "@maizzle/framework": "3.7.3",
"@prisma/client": "3.14.0", "@prisma/client": "3.14.0",
"@react-aria/interactions": "3.9.0", "@react-aria/interactions": "3.9.0",
"@remix-run/express": "1.5.1", "@remix-run/express": "1.14.3",
"@remix-run/node": "1.5.1", "@remix-run/node": "1.14.3",
"@remix-run/react": "1.5.1", "@remix-run/react": "1.14.3",
"@sentry/browser": "7.3.0", "@sentry/browser": "7.3.0",
"@sentry/node": "7.3.0", "@sentry/node": "7.3.0",
"@sentry/tracing": "7.3.0", "@sentry/tracing": "7.3.0",
@ -67,7 +67,7 @@
"remix-utils": "3.2.0", "remix-utils": "3.2.0",
"secure-password": "4.0.0", "secure-password": "4.0.0",
"stripe": "9.5.0", "stripe": "9.5.0",
"superjson-remix": "0.1.2", "superjson-remix": "0.2.0",
"tiny-invariant": "1.2.0", "tiny-invariant": "1.2.0",
"tslog": "3.3.3", "tslog": "3.3.3",
"twilio": "3.77.1", "twilio": "3.77.1",
@ -76,8 +76,8 @@
"zod": "3.17.3" "zod": "3.17.3"
}, },
"devDependencies": { "devDependencies": {
"@remix-run/dev": "1.5.1", "@remix-run/dev": "1.14.3",
"@remix-run/eslint-config": "1.5.1", "@remix-run/eslint-config": "1.14.3",
"@testing-library/cypress": "8.0.2", "@testing-library/cypress": "8.0.2",
"@testing-library/dom": "8.13.0", "@testing-library/dom": "8.13.0",
"@testing-library/jest-dom": "5.16.4", "@testing-library/jest-dom": "5.16.4",

View File

@ -1,6 +1,6 @@
import type { Request, Response } from "express"; import type { Request, Response } from "express";
import type { ActionFunction, DataFunctionArgs, LoaderFunction, ServerBuild } from "@remix-run/node"; import type { ActionFunction, DataFunctionArgs, LoaderFunction, ServerBuild } from "@remix-run/node";
import { isResponse } from "@remix-run/server-runtime/responses"; import { isResponse } from "@remix-run/server-runtime/dist/responses";
import type { Transaction } from "@sentry/types"; import type { Transaction } from "@sentry/types";
import * as Sentry from "@sentry/node"; import * as Sentry from "@sentry/node";
import { v4 as uuid } from "uuid"; import { v4 as uuid } from "uuid";
@ -24,7 +24,7 @@ function wrapDataFunc(func: ActionFunction | LoaderFunction, routeId: string, me
Sentry.configureScope((scope) => scope.setUser(null)); Sentry.configureScope((scope) => scope.setUser(null));
} }
const parentTransaction: Transaction | undefined = args.context && args.context.__sentry_transaction; const parentTransaction: Transaction | undefined = args.context && (args.context.__sentry_transaction as any);
const transaction = parentTransaction?.startChild({ const transaction = parentTransaction?.startChild({
op: `${method}:${routeId}`, op: `${method}:${routeId}`,
description: `${method}: ${routeId}`, description: `${method}: ${routeId}`,