Skip to content

Commit

Permalink
Format and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
3mcd committed Apr 4, 2024
1 parent ac93b36 commit 67441b6
Show file tree
Hide file tree
Showing 21 changed files with 47 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use client";

import { useCallback, useEffect, useTransition } from "react";
import { useRouter } from "next/navigation";
import { zodResolver } from "@hookform/resolvers/zod";
import { Community } from "@prisma/client";
import { useRouter } from "next/navigation";
import { useCallback, useEffect, useTransition } from "react";
import { useForm } from "react-hook-form";
import { useDebouncedCallback } from "use-debounce";
import { z } from "zod";
Expand All @@ -26,8 +26,8 @@ import { Input } from "ui/input";
import { toast } from "ui/use-toast";

import { didSucceed, useServerAction } from "~/lib/serverActions";
import { MemberFormState } from "./AddMember";
import * as actions from "./actions";
import { MemberFormState } from "./AddMember";
import { memberInviteFormSchema } from "./memberInviteFormSchema";

export const MemberInviteForm = ({
Expand Down
10 changes: 5 additions & 5 deletions core/app/c/[communitySlug]/members/[[...add]]/actions.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"use server";

import { cache } from "react";
import { revalidatePath, revalidateTag } from "next/cache";
import { headers } from "next/headers";
import { Community } from "@prisma/client";
import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";
import { User } from "@supabase/supabase-js";
import { revalidatePath, revalidateTag } from "next/cache";
import { headers } from "next/headers";
import { cache } from "react";

import type { SuggestedUser } from "~/lib/server/members";
import { getLoginData } from "~/lib/auth/loginData";
import { env } from "~/lib/env/env.mjs";
import type { SuggestedUser } from "~/lib/server/members";

import { defineServerAction } from "~/lib/server/defineServerAction";
import { generateHash, slugifyString } from "~/lib/string";
import { formatSupabaseError } from "~/lib/supabase";
Expand Down
1 change: 0 additions & 1 deletion core/app/c/[communitySlug]/stages/manage/StagesContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
useState,
} from "react";


import { useServerAction } from "~/lib/serverActions";
import { ActionPayload, StagePayload } from "~/lib/types";
import * as actions from "./actions";
Expand Down
1 change: 1 addition & 0 deletions core/app/c/[communitySlug]/stages/manage/actions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use server";

import { revalidateTag } from "next/cache";

import { defineServerAction } from "~/lib/server/defineServerAction";
import db from "~/prisma/db";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"use client";

import { logger } from "logger";
import { useCallback, useState } from "react";

import { logger } from "logger";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { Card, CardContent } from "ui/card";

import { SkeletonCard } from "~/app/components/skeletons/SkeletonCard";
import { addAction, deleteAction } from "../../actions";
import { getActions, getStage, getStageActions } from "./queries";
import { StagePanelActionCreator } from "./StagePanelActionCreator";
import { StagePanelActionEditor } from "./StagePanelActionEditor";
import { getActions, getStage, getStageActions } from "./queries";

type PropsInner = {
stageId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { Separator } from "ui/separator";

import { SkeletonCard } from "~/app/components/skeletons/SkeletonCard";
import { deleteStage, updateStageName } from "../../actions";
import { getStage } from "./queries";
import { StageNameInput } from "./StageNameInput";
import { StagePanelOverviewManagement } from "./StagePanelOverviewManagement";
import { getStage } from "./queries";

type PropsInner = {
stageId: string;
Expand Down
6 changes: 3 additions & 3 deletions core/app/global-error.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"use client";

import * as Sentry from "@sentry/nextjs";
import NextError from "next/error";
import { useEffect } from "react";
import NextError from "next/error";
import * as Sentry from "@sentry/nextjs";

export default function GlobalError({ error }: { error: Error & { digest?: string } }) {
useEffect(() => {
Sentry.captureException(error);
}, [error]);

return (
<html>
<html lang="en">
<body>
<NextError statusCode={undefined as any} />
</body>
Expand Down
5 changes: 3 additions & 2 deletions core/lib/server/defineServerAction.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { withServerActionInstrumentation } from "@sentry/nextjs";
import { headers } from "next/headers";
import { withServerActionInstrumentation } from "@sentry/nextjs";

import { isClientExceptionOptions, makeClientException } from "../serverActions";

/**
Expand Down Expand Up @@ -27,7 +28,7 @@ export const defineServerAction = <T extends (...args: unknown[]) => unknown>(
// server action result as-is.
return isClientExceptionOptions(serverActionResult)
? // Create a client exception and send its cause (if any) to Sentry.
makeClientException(serverActionResult)
makeClientException(serverActionResult)
: serverActionResult;
} catch (error) {
// https://github.com/vercel/next.js/discussions/49426#discussioncomment-8176059
Expand Down
3 changes: 2 additions & 1 deletion core/lib/serverActions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { captureException } from "@sentry/nextjs";
import { useCallback } from "react";
import { captureException } from "@sentry/nextjs";

import { toast } from "ui/use-toast";

export type ClientException = {
Expand Down
5 changes: 3 additions & 2 deletions integrations/evaluations/app/actions/evaluate/actions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"use server";

import { PubValues } from "@pubpub/sdk";
import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";
import { revalidatePath } from "next/cache";
import { headers } from "next/headers";
import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";

import { PubValues } from "@pubpub/sdk";
import { expect } from "utils";

import {
Expand Down
4 changes: 2 additions & 2 deletions integrations/evaluations/app/actions/manage/actions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"use server";

import { revalidatePath } from "next/cache";
import { headers } from "next/headers";
import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";

import { SuggestedMembersQuery } from "@pubpub/sdk";
import { expect } from "utils";
Expand All @@ -23,8 +25,6 @@ import {
isInvited,
} from "~/lib/types";
import { InviteFormEvaluator } from "./types";
import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";
import { headers } from "next/headers";

export const save = async (
instanceId: string,
Expand Down
2 changes: 1 addition & 1 deletion integrations/evaluations/app/actions/respond/actions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use server";

import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";
import { isRedirectError } from "next/dist/client/components/redirect";
import { headers } from "next/headers";
import { redirect } from "next/navigation";
import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";

import { expect } from "utils";

Expand Down
3 changes: 2 additions & 1 deletion integrations/evaluations/app/configure/actions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"use server";

import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";
import { headers } from "next/headers";
import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";

import { setInstanceConfig } from "~/lib/instance";
import { InstanceConfig } from "~/lib/types";

Expand Down
6 changes: 3 additions & 3 deletions integrations/evaluations/app/global-error.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"use client";

import * as Sentry from "@sentry/nextjs";
import NextError from "next/error";
import { useEffect } from "react";
import NextError from "next/error";
import * as Sentry from "@sentry/nextjs";

export default function GlobalError({ error }: { error: Error & { digest?: string } }) {
useEffect(() => {
Sentry.captureException(error);
}, [error]);

return (
<html>
<html lang="en">
<body>
<NextError statusCode={undefined as any} />
</body>
Expand Down
6 changes: 4 additions & 2 deletions integrations/submissions/app/actions/submit/actions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"use server";

import { PubValues } from "@pubpub/sdk";
import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";
import { headers } from "next/headers";
import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";

import { PubValues } from "@pubpub/sdk";

import { getInstanceConfig } from "~/lib/instance";
import { makePubFromDoi, makePubFromTitle, makePubFromUrl } from "~/lib/metadata";
import { client } from "~/lib/pubpub";
Expand Down
3 changes: 2 additions & 1 deletion integrations/submissions/app/configure/actions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"use server";

import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";
import { headers } from "next/headers";
import { captureException, withServerActionInstrumentation } from "@sentry/nextjs";

import { setInstanceConfig } from "~/lib/instance";

export const configure = async (instanceId: string, pubTypeId: string) => {
Expand Down
6 changes: 3 additions & 3 deletions integrations/submissions/app/global-error.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"use client";

import * as Sentry from "@sentry/nextjs";
import NextError from "next/error";
import { useEffect } from "react";
import NextError from "next/error";
import * as Sentry from "@sentry/nextjs";

export default function GlobalError({ error }: { error: Error & { digest?: string } }) {
useEffect(() => {
Sentry.captureException(error);
}, [error]);

return (
<html>
<html lang="en">
<body>
<NextError statusCode={undefined as any} />
</body>
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/data-table.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { Column, Table } from "@tanstack/react-table";

import * as React from "react";
import {
ArrowDownIcon,
Expand All @@ -9,7 +11,6 @@ import {
DoubleArrowRightIcon,
EyeNoneIcon,
} from "@radix-ui/react-icons";
import { Column, Table } from "@tanstack/react-table";

import { cn } from "utils";

Expand Down
13 changes: 4 additions & 9 deletions packages/ui/src/form.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
"use client";

import type * as LabelPrimitive from "@radix-ui/react-label";
import type { ControllerProps, FieldPath, FieldValues } from "react-hook-form";

import * as React from "react";
import * as LabelPrimitive from "@radix-ui/react-label";
import { Slot } from "@radix-ui/react-slot";
import {
Controller,
ControllerProps,
FieldPath,
FieldValues,
FormProvider,
useFormContext,
} from "react-hook-form";
import { Controller, FormProvider, useFormContext } from "react-hook-form";

import { cn } from "utils";

Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/pagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { ChevronLeftIcon, ChevronRightIcon, DotsHorizontalIcon } from "@radix-ui

import { cn } from "utils";

import { ButtonProps, buttonVariants } from "./button";
import type { ButtonProps } from "./button";
import { buttonVariants } from "./button";

const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (
<nav
Expand Down

0 comments on commit 67441b6

Please sign in to comment.