Skip to content

Commit

Permalink
update formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Din committed Dec 21, 2023
1 parent a50349a commit 39169f6
Show file tree
Hide file tree
Showing 59 changed files with 124 additions and 125 deletions.
1 change: 0 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
"printWidth": 100,
"semi": false,
"singleQuote": true,
"importOrder": ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
"plugins": ["@trivago/prettier-plugin-sort-imports"]
}
4 changes: 2 additions & 2 deletions @api/features/auth/email.validate-otp.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { createSession } from './helpers/create-session'
import { findSessionForAuth } from './helpers/find-session-for-auth'
import { EmailOtps, emailOtpSchema } from '@api/database/schema'
import { createUser } from '@api/lib/db'
import { procedure } from '@api/trpc'
import { generateFallbackAvatarUrl } from '@api/utils/generate-fallback-avatar-url'
import { TRPCError } from '@trpc/server'
import { eq } from 'drizzle-orm'
import { z } from 'zod'
import { createSession } from './helpers/create-session'
import { findSessionForAuth } from './helpers/find-session-for-auth'

export const authEmailValidateOtpRoute = procedure
.input(
Expand Down
2 changes: 1 addition & 1 deletion @api/features/auth/infos.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { authProcedure } from '@api/trpc'
import { findSessionForAuth } from './helpers/find-session-for-auth'
import { authProcedure } from '@api/trpc'

export const authInfosRoute = authProcedure.query(async ({ ctx }) => {
const findSession = findSessionForAuth({ ctx, sessionSecretKey: ctx.auth.session.secretKey })
Expand Down
2 changes: 1 addition & 1 deletion @api/features/auth/oauth.connect.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { getOauthUser } from './helpers/get-oauth-user'
import { OauthAccounts, oauthAccountSchema } from '@api/database/schema'
import { authProcedure } from '@api/trpc'
import { uppercaseFirstLetter } from '@shared/utils/uppercase-first-letter'
import { TRPCError } from '@trpc/server'
import { z } from 'zod'
import { getOauthUser } from './helpers/get-oauth-user'

export const authOauthConnectRoute = authProcedure
.input(
Expand Down
6 changes: 3 additions & 3 deletions @api/features/auth/oauth.login.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { createSession } from './helpers/create-session'
import { findSessionForAuth } from './helpers/find-session-for-auth'
import { getOauthUser } from './helpers/get-oauth-user'
import { oauthAccountSchema } from '@api/database/schema'
import { createUser } from '@api/lib/db'
import { procedure } from '@api/trpc'
import { uppercaseFirstLetter } from '@shared/utils/uppercase-first-letter'
import { TRPCError } from '@trpc/server'
import { z } from 'zod'
import { createSession } from './helpers/create-session'
import { findSessionForAuth } from './helpers/find-session-for-auth'
import { getOauthUser } from './helpers/get-oauth-user'

export const authOauthLoginRoute = procedure
.input(
Expand Down
2 changes: 1 addition & 1 deletion @api/features/auth/router.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { router } from '@api/trpc'
import { authEmailSendOtpRoute } from './email.send-otp'
import { authEmailValidateOtpRoute } from './email.validate-otp'
import { authInfosRoute } from './infos'
Expand All @@ -9,6 +8,7 @@ import { authOauthDisconnectRoute } from './oauth.disconnect'
import { authOauthLoginRoute } from './oauth.login'
import { authOrganizationSwitchRoute } from './organization-switch'
import { authProfileRouter } from './profile'
import { router } from '@api/trpc'

export const authRouter = router({
email: router({
Expand Down
2 changes: 1 addition & 1 deletion @api/features/organization/router.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { router } from '@api/trpc'
import { organizationChangeLogoRoute } from './change-logo'
import { organizationCreateRoute } from './create'
import { organizationDetailRoute } from './detail'
Expand All @@ -8,6 +7,7 @@ import { organizationMemberInvitationInfoRoute } from './member.invitation-info'
import { organizationMemberInviteRoute } from './member.invite'
import { organizationMemberRemoveRoute } from './member.remove'
import { organizationUpdateRoute } from './update'
import { router } from '@api/trpc'

export const organizationRouter = router({
list: organizationListRoute,
Expand Down
4 changes: 2 additions & 2 deletions @api/lib/db.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as schema from '../database/schema'
import type { Env } from '../env'
import { neon, neonConfig } from '@neondatabase/serverless'
import { TRPCError } from '@trpc/server'
import { drizzle as drizzleNeon } from 'drizzle-orm/neon-http'
import { withReplicas } from 'drizzle-orm/pg-core'
import { drizzle as drizzlePostgres } from 'drizzle-orm/postgres-js'
import postgres from 'postgres'
import * as schema from '../database/schema'
import type { Env } from '../env'

neonConfig.fetchConnectionCache = true

Expand Down
2 changes: 1 addition & 1 deletion @api/router.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server'
import { authRouter } from './features/auth/router'
import { organizationRouter } from './features/organization/router'
import { procedure, router } from './trpc'
import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server'

export const appRouter = router({
ping: procedure.query(() => 'pong'),
Expand Down
4 changes: 2 additions & 2 deletions @api/trpc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { TRPCError, experimental_standaloneMiddleware, initTRPC } from '@trpc/server'
import SuperJSON from 'superjson'
import type { Context } from './context'
import type { Db } from './lib/db'
import { TRPCError, experimental_standaloneMiddleware, initTRPC } from '@trpc/server'
import SuperJSON from 'superjson'

const t = initTRPC.context<Context & { request: Request }>().create({
transformer: SuperJSON,
Expand Down
2 changes: 1 addition & 1 deletion @api/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
*
* Learn more at https://developers.cloudflare.com/workers/
*/
import { fetchRequestHandler } from '@trpc/server/adapters/fetch'
import { createContext } from './context'
import { envSchema } from './env'
import { appRouter } from './router'
import { fetchRequestHandler } from '@trpc/server/adapters/fetch'

export default {
async fetch(request: Request, unvalidatedEnv: unknown, ec: ExecutionContext) {
Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/alert-dialog.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client'

import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog'
import * as React from 'react'
import { buttonVariants } from '@ui/_/../ui/button'
import { cn } from '@ui/utils/cn'
import * as React from 'react'

const AlertDialog = AlertDialogPrimitive.Root

Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/alert.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cn } from '@ui/utils/cn'
import { cva, type VariantProps } from 'class-variance-authority'
import * as React from 'react'
import { cn } from '@ui/utils/cn'

const alertVariants = cva(
'relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7',
Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client'

import * as AvatarPrimitive from '@radix-ui/react-avatar'
import * as React from 'react'
import { cn } from '@ui/utils/cn'
import * as React from 'react'

const Avatar = React.forwardRef<
React.ElementRef<typeof AvatarPrimitive.Root>,
Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Slot } from '@radix-ui/react-slot'
import { cn } from '@ui/utils/cn'
import { cva, type VariantProps } from 'class-variance-authority'
import * as React from 'react'
import { cn } from '@ui/utils/cn'

const buttonVariants = cva(
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/card.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { cn } from '@ui/utils/cn'
import * as React from 'react'

const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
({ className, ...props }, ref) => (
Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
import { CheckIcon } from '@radix-ui/react-icons'
import * as React from 'react'
import { cn } from '@ui/utils/cn'
import * as React from 'react'

const Checkbox = React.forwardRef<
React.ElementRef<typeof CheckboxPrimitive.Root>,
Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/dropdown-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'
import { CheckIcon, ChevronRightIcon, DotFilledIcon } from '@radix-ui/react-icons'
import * as React from 'react'
import { cn } from '@ui/utils/cn'
import * as React from 'react'

const DropdownMenu = DropdownMenuPrimitive.Root

Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/general-error.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Alert, AlertTitle, AlertDescription } from './alert'
import { ExclamationTriangleIcon } from '@radix-ui/react-icons'
import type { ComponentPropsWithoutRef } from 'react'
import { Alert, AlertTitle, AlertDescription } from './alert'

type Props = ComponentPropsWithoutRef<typeof Alert> & {
title?: string
Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/general-skeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { cn } from '@ui/utils/cn'
import { Skeleton } from './skeleton'
import { cn } from '@ui/utils/cn'

type Props = {
count: number
Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/input.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react'
import { cn } from '@ui/utils/cn'
import * as React from 'react'

export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}

Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/label.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client'

import * as LabelPrimitive from '@radix-ui/react-label'
import { cn } from '@ui/utils/cn'
import { cva, type VariantProps } from 'class-variance-authority'
import * as React from 'react'
import { cn } from '@ui/utils/cn'

const labelVariants = cva(
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/mutation-status-icon.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use client'

import { CheckIcon, Cross2Icon, ReloadIcon } from '@radix-ui/react-icons'
import { cn } from '@ui/utils/cn'
import { useState, useLayoutEffect } from 'react'
import { match } from 'ts-pattern'
import { cn } from '@ui/utils/cn'

export function MutationStatusIcon(props: {
status: 'idle' | 'loading' | 'success' | 'error'
Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/scroll-area.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client'

import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area'
import * as React from 'react'
import { cn } from '@ui/utils/cn'
import * as React from 'react'

const ScrollArea = React.forwardRef<
React.ElementRef<typeof ScrollAreaPrimitive.Root>,
Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import * as SheetPrimitive from '@radix-ui/react-dialog'
import { Cross2Icon } from '@radix-ui/react-icons'
import { cn } from '@ui/utils/cn'
import { cva, type VariantProps } from 'class-variance-authority'
import * as React from 'react'
import { cn } from '@ui/utils/cn'

const Sheet = SheetPrimitive.Root

Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/toast.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Cross2Icon } from '@radix-ui/react-icons'
import * as ToastPrimitives from '@radix-ui/react-toast'
import { cn } from '@ui/utils/cn'
import { cva, type VariantProps } from 'class-variance-authority'
import * as React from 'react'
import { cn } from '@ui/utils/cn'

const ToastProvider = ToastPrimitives.Provider

Expand Down
2 changes: 1 addition & 1 deletion @ui/ui/use-toast.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Inspired by react-hot-toast library
import * as React from 'react'
import type { ToastActionElement, ToastProps } from '@ui/_/../ui/toast'
import * as React from 'react'

const TOAST_LIMIT = 1
const TOAST_REMOVE_DELAY = 1000000
Expand Down
4 changes: 2 additions & 2 deletions @web/app/(auth)/(settings)/_components/nav.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use client'

import { Skeleton } from '@ui/ui/skeleton'
import { ViewportBlock } from '@ui/ui/viewport-block'
import { api } from '@web/lib/api'
import { isActivePathname } from '@web/utils/is-active-pathname'
import Link from 'next/link'
import { usePathname, useSearchParams } from 'next/navigation'
import { Skeleton } from '@ui/ui/skeleton'
import { ViewportBlock } from '@ui/ui/viewport-block'

const staticLinks = [
{
Expand Down
2 changes: 1 addition & 1 deletion @web/app/(auth)/(settings)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ScrollArea, ScrollBar } from '@ui/ui/scroll-area'
import { Nav } from './_components/nav'
import { ScrollArea, ScrollBar } from '@ui/ui/scroll-area'

export default function ProfileLayout({ children }: { children: React.ReactNode }) {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
'use client'

import { Avatar, AvatarFallback, AvatarImage } from '@ui/ui/avatar'
import { Button } from '@ui/ui/button'
import { GeneralError } from '@ui/ui/general-error'
import { GeneralSkeleton } from '@ui/ui/general-skeleton'
import { Input } from '@ui/ui/input'
import { Label } from '@ui/ui/label'
import { MutationStatusIcon } from '@ui/ui/mutation-status-icon'
import { api } from '@web/lib/api'
import { constructPublicResourceUrl } from '@web/utils/construct-public-resource-url'
import imageCompression from 'browser-image-compression'
Expand All @@ -8,13 +15,6 @@ import { useSearchParams } from 'next/navigation'
import { useId, useRef } from 'react'
import { match } from 'ts-pattern'
import { z } from 'zod'
import { Avatar, AvatarFallback, AvatarImage } from '@ui/ui/avatar'
import { Button } from '@ui/ui/button'
import { GeneralError } from '@ui/ui/general-error'
import { GeneralSkeleton } from '@ui/ui/general-skeleton'
import { Input } from '@ui/ui/input'
import { Label } from '@ui/ui/label'
import { MutationStatusIcon } from '@ui/ui/mutation-status-icon'

export function OrganizationInfosForm() {
const searchParams = useSearchParams()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import type { ApiOutputs } from '@web/lib/api'
import { api } from '@web/lib/api'
import { useId, useRef } from 'react'
import { z } from 'zod'
import { Button } from '@ui/ui/button'
import { Checkbox } from '@ui/ui/checkbox'
import { Input } from '@ui/ui/input'
Expand All @@ -15,6 +11,10 @@ import {
SheetHeader,
SheetTitle,
} from '@ui/ui/sheet'
import type { ApiOutputs } from '@web/lib/api'
import { api } from '@web/lib/api'
import { useId, useRef } from 'react'
import { z } from 'zod'

type Props = React.ComponentPropsWithoutRef<typeof Sheet> & {
organizationId: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
'use client'

import { OrganizationMemberInviteSheet } from './organization-member-invite-sheet'
import { PlusIcon } from '@radix-ui/react-icons'
import { uppercaseFirstLetter } from '@shared/utils/uppercase-first-letter'
import { useAuthenticatedUser } from '@web/hooks/use-user'
import { api } from '@web/lib/api'
import { constructPublicResourceUrl } from '@web/utils/construct-public-resource-url'
import { useSearchParams } from 'next/navigation'
import { useRef } from 'react'
import { match } from 'ts-pattern'
import { z } from 'zod'
import {
AlertDialog,
AlertDialogCancel,
Expand All @@ -25,7 +19,13 @@ import { GeneralError } from '@ui/ui/general-error'
import { GeneralSkeleton } from '@ui/ui/general-skeleton'
import { MutationStatusIcon } from '@ui/ui/mutation-status-icon'
import { SheetTrigger } from '@ui/ui/sheet'
import { OrganizationMemberInviteSheet } from './organization-member-invite-sheet'
import { useAuthenticatedUser } from '@web/hooks/use-user'
import { api } from '@web/lib/api'
import { constructPublicResourceUrl } from '@web/utils/construct-public-resource-url'
import { useSearchParams } from 'next/navigation'
import { useRef } from 'react'
import { match } from 'ts-pattern'
import { z } from 'zod'

export function OrganizationMembers() {
const searchParams = useSearchParams()
Expand Down
2 changes: 1 addition & 1 deletion @web/app/(auth)/(settings)/organization/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Metadata } from 'next'
import { OrganizationInfosForm } from './_components/organization-infos-form'
import { OrganizationMembers } from './_components/organization-members'
import type { Metadata } from 'next'

export const metadata: Metadata = {
title: 'Organization',
Expand Down
Loading

0 comments on commit 39169f6

Please sign in to comment.