Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Dependencies

on:
pull_request:
branches:
- main
- develop
push:
branches:
- main
- develop
workflow_dispatch:

jobs:
knip:
name: Knip
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.2.20"

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Run Knip
run: bun run knip
17 changes: 9 additions & 8 deletions .github/workflows/test.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Tests
name: Tests

on:
push:
Expand All @@ -8,7 +8,7 @@ on:

jobs:
unit-tests:
name: Unit Tests
name: Unit
runs-on: ubuntu-latest

# unit tests don't need environment variables - they test pure functions
Expand All @@ -18,22 +18,23 @@ jobs:
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.2.20
bun-version: "1.2.20"

- name: Install dependencies
run: bun install
run: bun install --frozen-lockfile

- name: Run unit tests
run: bun test:unit

integration-tests:
name: Integration Tests
name: Integration
runs-on: ubuntu-latest
needs: unit-tests # run after unit tests pass
needs: unit-tests # run after unit tests pass

# these are placeholders which is fine for integration tests
# these are placeholders which is fine for integration tests for now
# TODO: remove these and set-up an actual integration test suite environment
env:
KV_URL: redis://localhost:6379
KV_REST_API_READ_ONLY_TOKEN: test-read-only-token
Expand Down
722 changes: 156 additions & 566 deletions bun.lock

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$schema": "https://unpkg.com/knip@latest/schema.json",
"entry": [
"src/app/**/*.{ts,tsx}",
"src/middleware.ts",
"src/instrumentation.ts",
"src/instrumentation.node.ts",
"next.config.mjs",
"postcss.config.js",
"eslint.config.mjs",
"vitest.config.ts",
"scripts/**/*.ts"
],
"project": [
"src/**/*.{ts,tsx}",
"scripts/**/*.ts"
],
"ignore": [
"src/types/**/*.d.ts",
"**/*.test.{ts,tsx}",
"**/*.spec.{ts,tsx}"
],
"ignoreDependencies": [
"prettier-plugin-*",
"eslint-plugin-*",
"eslint-config-*",
"autoprefixer",
"postcss",
"postcss-import",
"tailwindcss",
"tailwindcss-animate",
"node-loader",
"babel-plugin-react-compiler",
"@vitest/coverage-v8",
"@vitest/ui",
"pino-pretty"
],
"next": {
"entry": [
"src/app/**/*.{ts,tsx}!",
"src/middleware.ts",
"src/instrumentation.ts"
]
},
"vitest": {
"entry": [
"vitest.config.ts",
"src/__test__/setup.ts"
]
}
}
30 changes: 7 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"lint": "next lint",
"lint:fix": "next lint --fix",
"format": "prettier --write .",
"knip": "knip",
"knip:production": "knip --production",
"prebuild": "bun scripts:check-app-env",
"<<<<<<< Development Tools": "",
"scan:local": "bunx react-scan@latest localhost:3000",
Expand Down Expand Up @@ -98,22 +100,16 @@
"echarts": "^6.0.0",
"echarts-for-react": "^3.0.2",
"fast-xml-parser": "^4.5.1",
"fumadocs-core": "^15.0.6",
"fumadocs-mdx": "^11.5.3",
"fumadocs-ui": "^15.0.6",
"geist": "^1.3.1",
"immer": "^10.1.1",
"lucide-react": "^0.525.0",
"micromatch": "^4.0.8",
"motion": "^12.18.1",
"nanoid": "^5.0.9",
"next": "15.3.0-canary.23",
"next-safe-action": "^7.10.4",
"next-themes": "^0.4.6",
"openapi-fetch": "^0.14.0",
"pathe": "^2.0.3",
"pino": "^9.7.0",
"postgres": "^3.4.5",
"posthog-js": "^1.214.0",
"react": "^19.1.0",
"react-day-picker": "^9.9.0",
Expand All @@ -122,11 +118,7 @@
"react-hook-form": "^7.54.2",
"react-icons": "^5.4.0",
"react-shiki": "^0.5.2",
"react-svg": "^16.3.0",
"recharts": "^2.15.1",
"rehype-katex": "^7.0.1",
"remark-math": "^6.0.0",
"remark-mermaid": "^0.2.0",
"semver": "^7.7.2",
"serialize-error": "^12.0.0",
"shiki": "3.2.1",
Expand All @@ -142,43 +134,35 @@
"zustand-computed": "^2.0.2"
},
"devDependencies": {
"@bufbuild/buf": "^1.54.0",
"@bufbuild/protobuf": "^2.5.2",
"@bufbuild/protoc-gen-es": "^2.5.2",
"@connectrpc/protoc-gen-connect-es": "^1.6.1",
"@next/eslint-plugin-next": "^15.1.6",
"@tailwindcss/postcss": "^4.0.15",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@types/bun": "^1.2.5",
"pino-pretty": "^13.1.1",
"@types/node": "22.10.10",
"@types/pg": "^8.11.11",
"@types/node": "^24.6.0",
"@types/react": "^19.0.8",
"@types/react-dom": "19.0.3",
"@types/semver": "^7.7.0",
"@vitest/coverage-v8": "^3.0.7",
"@vitest/ui": "3.0.7",
"autoprefixer": "^10.4.20",
"babel-plugin-react-compiler": "^19.1.0-rc.2",
"drizzle-kit": "^0.30.3",
"eslint": "^9.19.0",
"eslint-config-next": "^15.1.6",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.3",
"knip": "^5.64.1",
"node-loader": "^2.1.0",
"openapi-typescript": "^7.8.0",
"pino-pretty": "^13.1.1",
"postcss": "8.5.1",
"postcss-import": "^16.1.0",
"prettier": "^3.4.2",
"prettier-plugin-organize-imports": "^4.1.0",
"prettier-plugin-tailwindcss": "^0.6.11",
"react-scan": "^0.4.3",
"server-cli-only": "^0.3.2",
"tailwindcss": "^4.0.15",
"tailwindcss-animate": "^1.0.7",
"tsx": "^4.19.2",
"typescript": "5.7.3",
"typescript": "^5.9.2",
"vitest": "^3.0.7"
},
"resolutions": {
Expand All @@ -189,5 +173,5 @@
"@nodelib/fs.scandir": "2.1.5",
"@nodelib/fs.stat": "2.0.5"
},
"packageManager": "[email protected].0"
"packageManager": "[email protected].20"
}
4 changes: 4 additions & 0 deletions src/__test__/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ vi.mock('@/lib/clients/logger', () => ({
debug: console.info,
},
}))

vi.mock('server-only', () => {
return {}
})
2 changes: 1 addition & 1 deletion src/app/api/teams/[teamId]/metrics/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'server-cli-only'
import 'server-only'

import { SUPABASE_AUTH_HEADERS } from '@/configs/api'
import { USE_MOCK_DATA } from '@/configs/flags'
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/teams/[teamId]/sandboxes/metrics/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'server-cli-only'
import 'server-only'

import { SUPABASE_AUTH_HEADERS } from '@/configs/api'
import { infra } from '@/lib/clients/api'
Expand Down
2 changes: 1 addition & 1 deletion src/features/dashboard/sandbox/inspect/frame.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { cn } from '@/lib/utils'
import { motion } from 'framer-motion'
import { motion } from 'motion/react'
import React from 'react'

type SandboxInspectFrameProps = React.ComponentProps<typeof motion.div> & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
CardTitle,
cardVariants,
} from '@/ui/primitives/card'
import { AnimatePresence, motion } from 'framer-motion'
import { AlertTriangle } from 'lucide-react'
import { AnimatePresence, motion } from 'motion/react'
import { useMemo } from 'react'
import { useSandboxContext } from '../context'
import { useLastUpdated, useWatcherError } from './hooks/use-watcher'
Expand Down
2 changes: 1 addition & 1 deletion src/features/dashboard/sandbox/inspect/viewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { cn } from '@/lib/utils'
import { Button } from '@/ui/primitives/button'
import { Drawer, DrawerContent } from '@/ui/primitives/drawer'
import { ScrollArea, ScrollBar } from '@/ui/primitives/scroll-area'
import { AnimatePresence } from 'framer-motion'
import { Download } from 'lucide-react'
import { AnimatePresence } from 'motion/react'
import { useEffect, useState } from 'react'
import ShikiHighlighter, { Language } from 'react-shiki'
import SandboxInspectFrame from './frame'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client'

import { AnimatePresence, motion } from 'framer-motion'
import { ChevronRight } from 'lucide-react'
import { AnimatePresence, motion } from 'motion/react'
import { ReactNode, memo, useCallback, useEffect, useRef } from 'react'

import { cn } from '@/lib/utils'
Expand Down
2 changes: 1 addition & 1 deletion src/features/dashboard/team/profile-picture-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { uploadTeamProfilePictureAction } from '@/server/team/team-actions'
import { Avatar, AvatarFallback, AvatarImage } from '@/ui/primitives/avatar'
import { Badge } from '@/ui/primitives/badge'
import { cardVariants } from '@/ui/primitives/card'
import { AnimatePresence, motion } from 'framer-motion'
import { ChevronsUp, ImagePlusIcon, Loader2, Pencil } from 'lucide-react'
import { AnimatePresence, motion } from 'motion/react'
import { useAction } from 'next-safe-action/hooks'
import { useRef, useState } from 'react'

Expand Down
2 changes: 1 addition & 1 deletion src/features/docs/sidebar/sidebar-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { cn, exponentialSmoothing } from '@/lib/utils'
import { isActive } from '@/lib/utils/docs'
import { Button, buttonVariants } from '@/ui/primitives/button'
import { Separator } from '@/ui/primitives/separator'
import { AnimatePresence, motion, type Variants } from 'framer-motion'
import { PageTree } from 'fumadocs-core/server'
import { ChevronRight } from 'lucide-react'
import { AnimatePresence, motion, type Variants } from 'motion/react'
import Link from 'next/link'
import { usePathname } from 'next/navigation'
import React from 'react'
Expand Down
2 changes: 1 addition & 1 deletion src/lib/clients/supabase/admin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'server-cli-only'
import 'server-only'

import { Database } from '@/types/database.types'
import { createClient } from '@supabase/supabase-js'
Expand Down
2 changes: 1 addition & 1 deletion src/lib/clients/supabase/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'server-cli-only'
import 'server-only'

import { Database } from '@/types/database.types'
import { createServerClient } from '@supabase/ssr'
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'server-cli-only'
import 'server-only'

import { SUPABASE_AUTH_HEADERS } from '@/configs/api'
import { COOKIE_KEYS, KV_KEYS } from '@/configs/keys'
Expand Down
2 changes: 1 addition & 1 deletion src/server/auth/get-default-team.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'server-cli-only'
import 'server-only'

import { l } from '@/lib/clients/logger/logger'
import { supabaseAdmin } from '@/lib/clients/supabase/admin'
Expand Down
2 changes: 1 addition & 1 deletion src/server/auth/get-session.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createClient } from '@/lib/clients/supabase/server'
import 'server-cli-only'
import 'server-only'

/**
* Retrieves the current user session from Supabase authentication in an insecure way.
Expand Down
2 changes: 1 addition & 1 deletion src/server/sandboxes/get-team-metrics-memo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'server-cli-only'
import 'server-only'

import { SUPABASE_AUTH_HEADERS } from '@/configs/api'
import { infra } from '@/lib/clients/api'
Expand Down
2 changes: 1 addition & 1 deletion src/server/sandboxes/get-team-sandboxes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'server-cli-only'
import 'server-only'

import { SUPABASE_AUTH_HEADERS } from '@/configs/api'
import { USE_MOCK_DATA } from '@/configs/flags'
Expand Down
2 changes: 1 addition & 1 deletion src/server/team/get-team-tier-limits-memo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'server-cli-only'
import 'server-only'

import { l } from '@/lib/clients/logger/logger'
import { supabaseAdmin } from '@/lib/clients/supabase/admin'
Expand Down
5 changes: 2 additions & 3 deletions src/ui/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { cn } from '@/lib/utils'
import type { LucideIcon } from 'lucide-react'
import { TerminalIcon } from 'lucide-react'
import { type HTMLAttributes } from 'react'
import { IconBaseProps } from 'react-icons/lib'

export function IconContainer({
icon: Icon,
Expand All @@ -27,7 +26,7 @@ export function IconContainer({
)
}

export function PiSmileyStarEyesFill({ size = '32px' }: IconBaseProps) {
export function PiSmileyStarEyesFill({ size = '32px' }) {
return (
<svg
width={size}
Expand All @@ -47,7 +46,7 @@ export function PiSmileyStarEyesFill({ size = '32px' }: IconBaseProps) {
)
}

export function PiSmileyHeartEyesFill({ size = '32px' }: IconBaseProps) {
export function PiSmileyHeartEyesFill({ size = '32px' }) {
return (
<svg
width={size}
Expand Down
Loading