Skip to content

Commit

Permalink
chore: run prettier on imports
Browse files Browse the repository at this point in the history
  • Loading branch information
codeincontext committed Oct 29, 2024
1 parent 6435a39 commit e353103
Show file tree
Hide file tree
Showing 59 changed files with 120 additions and 221 deletions.
5 changes: 2 additions & 3 deletions apps/nextjs/src/ai-apps/common/state/create-parts.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import type {
GenerationPart,
GenerationPartAIGenerated,
GenerationPartUserTweaked} from "@oakai/core/src/types";
import {
GenerationPartType
GenerationPartUserTweaked,
} from "@oakai/core/src/types";
import { GenerationPartType } from "@oakai/core/src/types";

export function createAIGeneratedPart<Value>(
value: Value,
Expand Down
11 changes: 3 additions & 8 deletions apps/nextjs/src/ai-apps/quiz-designer/state/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@ import {
import { removeAtIndex, updateAtIndex } from "ai-apps/common/state/helpers";
import type { PotentialQuestionsType } from "hooks/useSuggestedQuestions";

import type { QuizAppAction} from "./actions";
import type { QuizAppAction } from "./actions";
import { QuizAppActions } from "./actions";
import type {
QuizAppState,
QuizAppStateQuestion} from "./types";
import {
QuizAppStatus,
QuizQuestionType,
} from "./types";
import type { QuizAppState, QuizAppStateQuestion } from "./types";
import { QuizAppStatus, QuizQuestionType } from "./types";

export function quizAppReducer(
state: QuizAppState,
Expand Down
4 changes: 2 additions & 2 deletions apps/nextjs/src/app/actions.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"use server";

import type { AilaPersistedChat} from "@oakai/aila/src/protocol/schema";
import type { AilaPersistedChat } from "@oakai/aila/src/protocol/schema";
import { chatSchema } from "@oakai/aila/src/protocol/schema";
import type { Prisma} from "@oakai/db";
import type { Prisma } from "@oakai/db";
import { prisma } from "@oakai/db";
import * as Sentry from "@sentry/nextjs";

Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/aila/[id]/share/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { User} from "@clerk/nextjs/server";
import type { User } from "@clerk/nextjs/server";
import { clerkClient } from "@clerk/nextjs/server";
import { getSessionModerations } from "@oakai/aila/src/features/moderation/getSessionModerations";
import { demoUsers } from "@oakai/core";
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/api/aila-download-all/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { auth } from "@clerk/nextjs/server";
import type { LessonExportType} from "@oakai/db";
import type { LessonExportType } from "@oakai/db";
import { prisma } from "@oakai/db";
import { downloadDriveFile } from "@oakai/exports";
import * as Sentry from "@sentry/node";
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/api/aila-download/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { auth } from "@clerk/nextjs/server";
import type { LessonExportType} from "@oakai/db";
import type { LessonExportType } from "@oakai/db";
import { prisma } from "@oakai/db";
import { downloadDriveFile } from "@oakai/exports";
import * as Sentry from "@sentry/node";
Expand Down
9 changes: 3 additions & 6 deletions apps/nextjs/src/app/api/chat/chatHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ import {
} from "@oakai/aila/src/features/analytics";
import { AilaRag } from "@oakai/aila/src/features/rag/AilaRag";
import type { LooseLessonPlan } from "@oakai/aila/src/protocol/schema";
import type {
TracingSpan} from "@oakai/core/src/tracing/serverTracing";
import {
withTelemetry,
} from "@oakai/core/src/tracing/serverTracing";
import type { PrismaClientWithAccelerate} from "@oakai/db";
import type { TracingSpan } from "@oakai/core/src/tracing/serverTracing";
import { withTelemetry } from "@oakai/core/src/tracing/serverTracing";
import type { PrismaClientWithAccelerate } from "@oakai/db";
import { prisma as globalPrisma } from "@oakai/db";
import { aiLogger } from "@oakai/logger";
// #TODO StreamingTextResponse is deprecated. If we choose to adopt the "ai" package
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/api/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextRequest } from "next/server";
import { withSentry } from "@/lib/sentry/withSentry";

import { handleChatPostRequest } from "./chatHandler";
import type { Config} from "./config";
import type { Config } from "./config";
import { defaultConfig } from "./config";

async function postHandler(req: NextRequest): Promise<Response> {
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/api/qd-download/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { auth } from "@clerk/nextjs/server";
import type { LessonExportType} from "@oakai/db";
import type { LessonExportType } from "@oakai/db";
import { prisma } from "@oakai/db";
import { downloadDriveFile } from "@oakai/exports";
import * as Sentry from "@sentry/node";
Expand Down
3 changes: 1 addition & 2 deletions apps/nextjs/src/app/home-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import { useUser } from "@clerk/nextjs";
import MuxPlayer from "@mux/mux-player-react";
import type {
OakColorToken} from "@oaknational/oak-components";
import type { OakColorToken } from "@oaknational/oak-components";
import {
OakBox,
OakFlex,
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/quiz-designer/quiz-designer-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { memo, useCallback, useEffect, useReducer, useState } from "react";
import { useUser } from "@clerk/nextjs";
import { aiLogger } from "@oakai/logger";
import { quizAppReducer } from "ai-apps/quiz-designer/state/reducer";
import type { QuizAppState} from "ai-apps/quiz-designer/state/types";
import type { QuizAppState } from "ai-apps/quiz-designer/state/types";
import { QuizAppStatus } from "ai-apps/quiz-designer/state/types";
import { useQuizSession } from "hooks/useQuizSession";
import { useRouter } from "next/navigation";
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/app/user/[[...index]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UserProfile } from '@clerk/nextjs'
import { UserProfile } from "@clerk/nextjs";

export default function Page() {
return (
Expand Down
11 changes: 2 additions & 9 deletions apps/nextjs/src/components/AppComponents/Chat/chat-list.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
"use client";

import type {
Dispatch,
SetStateAction} from "react";
import {
useCallback,
useEffect,
useRef,
useState,
} from "react";
import type { Dispatch, SetStateAction } from "react";
import { useCallback, useEffect, useRef, useState } from "react";

import type { PersistedModerationBase } from "@oakai/core/src/utils/ailaModeration/moderationSchema";
import { OakBox, OakFlex, OakIcon, OakSpan } from "@oaknational/oak-components";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Inspired by Chatbot-UI and modified to fit the needs of this project
// @see https://github.com/mckaywrigley/chatbot-ui/blob/main/components/Chat/ChatMessage.tsx
import type { ReactNode} from "react";
import type { ReactNode } from "react";
import { useState } from "react";

import type {
Expand All @@ -14,10 +14,9 @@ import type {
PromptDocument,
StateDocument,
TextDocument,
UnknownDocument} from "@oakai/aila/src/protocol/jsonPatchProtocol";
import {
parseMessageParts,
UnknownDocument,
} from "@oakai/aila/src/protocol/jsonPatchProtocol";
import { parseMessageParts } from "@oakai/aila/src/protocol/jsonPatchProtocol";
import { isSafe } from "@oakai/core/src/utils/ailaModeration/helpers";
import type { PersistedModerationBase } from "@oakai/core/src/utils/ailaModeration/moderationSchema";
import { aiLogger } from "@oakai/logger";
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/components/AppComponents/Chat/markdown.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { FC} from "react";
import type { FC } from "react";
import React, { memo } from "react";
import type { Options } from "react-markdown";
import ReactMarkdown from "react-markdown";
Expand Down
9 changes: 5 additions & 4 deletions apps/nextjs/src/components/AppComponents/Chat/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as React from 'react'
import { Slot } from '@radix-ui/react-slot'
import { cva, type VariantProps } from 'class-variance-authority'
import * as React from "react";

import { cn } from '@/lib/utils'
import { Slot } from "@radix-ui/react-slot";
import { cva, type VariantProps } from "class-variance-authority";

import { cn } from "@/lib/utils";

const buttonVariants = cva(
'inline-flex items-center justify-center rounded-md text-sm font-medium shadow ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client";

import type { FC} from "react";
import type { FC } from "react";
import { memo } from "react";
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { coldarkDark } from "react-syntax-highlighter/dist/cjs/styles/prism";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Dispatch, SetStateAction} from "react";
import type { Dispatch, SetStateAction } from "react";
import { useMemo } from "react";

import { Box, Grid, Text } from "@radix-ui/themes";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ import { useEffect, useMemo } from "react";

import type {
KeyStageName,
SubjectName} from "@oakai/core/src/data/subjectsAndKeyStages";
import {
subjectsAndKeyStages,
SubjectName,
} from "@oakai/core/src/data/subjectsAndKeyStages";
import { subjectsAndKeyStages } from "@oakai/core/src/data/subjectsAndKeyStages";
import { Flex } from "@radix-ui/themes";

import Input from "@/components/Input";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import { useState } from "react";
import * as Dialog from "@radix-ui/react-dialog";
import * as Sentry from "@sentry/react";

import type {
ModerationFeedbackFormProps} from "@/components/AppComponents/FeedbackForms/ModerationFeedbackForm";
import {
ModerationFeedbackForm
} from "@/components/AppComponents/FeedbackForms/ModerationFeedbackForm";
import type { ModerationFeedbackFormProps } from "@/components/AppComponents/FeedbackForms/ModerationFeedbackForm";
import { ModerationFeedbackForm } from "@/components/AppComponents/FeedbackForms/ModerationFeedbackForm";

import { dialogOverlay } from "../../DialogControl/dialogStyles";

Expand Down
11 changes: 4 additions & 7 deletions apps/nextjs/src/components/AppComponents/QuizDesigner/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import type { Dispatch} from "react";
import type { Dispatch } from "react";
import { useCallback } from "react";

import type { KeyStageName, SubjectName } from "@oakai/core";
import { Box, Flex, Heading, Text } from "@radix-ui/themes";
import type {
QuizAppAction} from "ai-apps/quiz-designer/state/actions";
import {
QuizAppActions,
} from "ai-apps/quiz-designer/state/actions";
import type { QuizAppState} from "ai-apps/quiz-designer/state/types";
import type { QuizAppAction } from "ai-apps/quiz-designer/state/actions";
import { QuizAppActions } from "ai-apps/quiz-designer/state/actions";
import type { QuizAppState } from "ai-apps/quiz-designer/state/types";
import { QuizAppStatus } from "ai-apps/quiz-designer/state/types";
import Image from "next/image";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Dispatch} from "react";
import type { Dispatch } from "react";
import { useRef } from "react";

import { Box, Container } from "@radix-ui/themes";
import type { QuizAppAction } from "ai-apps/quiz-designer/state/actions";
import type { QuizAppState} from "ai-apps/quiz-designer/state/types";
import type { QuizAppState } from "ai-apps/quiz-designer/state/types";
import { QuizAppStatus } from "ai-apps/quiz-designer/state/types";
import useShareContent from "hooks/useShareContent";
import useSuggestedQuestions from "hooks/useSuggestedQuestions";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Dispatch} from "react";
import type { Dispatch } from "react";
import { useRef } from "react";

import { Box, Container } from "@radix-ui/themes";
Expand All @@ -12,11 +12,8 @@ import RateLimitNotification from "@/components/AppComponents/common/RateLimitNo
import Layout from "@/components/Layout";

import type { QuizAppAction } from "../../../ai-apps/quiz-designer/state/actions";
import type {
QuizAppState} from "../../../ai-apps/quiz-designer/state/types";
import {
QuizAppStatus,
} from "../../../ai-apps/quiz-designer/state/types";
import type { QuizAppState } from "../../../ai-apps/quiz-designer/state/types";
import { QuizAppStatus } from "../../../ai-apps/quiz-designer/state/types";
import SuggestedQuestions from "./SuggestedQuestions";

type Props = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { useCallback } from "react";

import type { GenerationPart} from "@oakai/core/src/types";
import type { GenerationPart } from "@oakai/core/src/types";
import { GenerationPartType } from "@oakai/core/src/types";
import browserLogger from "@oakai/logger/browser";
import { Flex } from "@radix-ui/themes";
import type {
QuizAppAction} from "ai-apps/quiz-designer/state/actions";
import {
QuizAppActions,
} from "ai-apps/quiz-designer/state/actions";
import type { QuizAppAction } from "ai-apps/quiz-designer/state/actions";
import { QuizAppActions } from "ai-apps/quiz-designer/state/actions";
import type {
QuizAppAnswer,
QuizAppState,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Dispatch} from "react";
import type { Dispatch } from "react";
import { useState } from "react";

import { Box, Flex } from "@radix-ui/themes";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import type { Dispatch} from "react";
import type { Dispatch } from "react";
import { useState } from "react";

import { Flex, Heading } from "@radix-ui/themes";
import type {
QuizAppAction} from "ai-apps/quiz-designer/state/actions";
import {
QuizAppActions,
} from "ai-apps/quiz-designer/state/actions";
import type { QuizAppAction } from "ai-apps/quiz-designer/state/actions";
import { QuizAppActions } from "ai-apps/quiz-designer/state/actions";

import useAnalytics from "@/lib/analytics/useAnalytics";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import type { Dispatch} from "react";
import type { Dispatch } from "react";
import { useCallback, useState } from "react";

import type { GenerationPart} from "@oakai/core/src/types";
import type { GenerationPart } from "@oakai/core/src/types";
import { GenerationPartType } from "@oakai/core/src/types";
import browserLogger from "@oakai/logger/browser";
import { Flex } from "@radix-ui/themes";
import type {
QuizAppAction} from "ai-apps/quiz-designer/state/actions";
import {
QuizAppActions,
} from "ai-apps/quiz-designer/state/actions";
import type { QuizAppAction } from "ai-apps/quiz-designer/state/actions";
import { QuizAppActions } from "ai-apps/quiz-designer/state/actions";
import type {
QuizAppDistractor,
QuizAppState,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import type { Dispatch} from "react";
import type { Dispatch } from "react";
import { useCallback } from "react";

import { Box, Flex } from "@radix-ui/themes";
import { quizRequestGeneration } from "ai-apps/quiz-designer/quizRequestGeneration";
import type {
QuizAppAction} from "ai-apps/quiz-designer/state/actions";
import {
QuizAppActions,
} from "ai-apps/quiz-designer/state/actions";
import type { QuizAppAction } from "ai-apps/quiz-designer/state/actions";
import { QuizAppActions } from "ai-apps/quiz-designer/state/actions";
import type {
QuizAppState,
QuizAppStateQuestion,
} from "ai-apps/quiz-designer/state/types";
import type {
GenerationWithResponse} from "hooks/useGeneration";
import type { GenerationWithResponse } from "hooks/useGeneration";
import {
UseGenerationStatus,
isGenerationHookLoading,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { Flex } from "@radix-ui/themes";
import type {
UseGenerationStatus} from "hooks/useGeneration";
import {
isGenerationHookLoading,
} from "hooks/useGeneration";
import type { UseGenerationStatus } from "hooks/useGeneration";
import { isGenerationHookLoading } from "hooks/useGeneration";

import { trpc } from "@/utils/trpc";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import type { Dispatch } from "react";

import { Box, Flex, Heading, Text } from "@radix-ui/themes";
import type {
QuizAppAction} from "ai-apps/quiz-designer/state/actions";
import {
QuizAppActions,
} from "ai-apps/quiz-designer/state/actions";
import type { QuizAppAction } from "ai-apps/quiz-designer/state/actions";
import { QuizAppActions } from "ai-apps/quiz-designer/state/actions";
import type {
QuizAppState,
QuizAppStateQuestion,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import type { Dispatch} from "react";
import type { Dispatch } from "react";
import { useCallback } from "react";

import * as Sentry from "@sentry/nextjs";
import type {
QuizAppAction} from "ai-apps/quiz-designer/state/actions";
import {
QuizAppActions,
} from "ai-apps/quiz-designer/state/actions";
import type { QuizAppAction } from "ai-apps/quiz-designer/state/actions";
import { QuizAppActions } from "ai-apps/quiz-designer/state/actions";
import type { QuizAppState } from "ai-apps/quiz-designer/state/types";

import { trpc } from "@/utils/trpc";
Expand Down
Loading

0 comments on commit e353103

Please sign in to comment.