Jelajahi Sumber

Update next.js (#11108)

Chris Estreich 1 Minggu lalu
induk
melakukan
fd46e31134
39 mengubah file dengan 507 tambahan dan 300 penghapusan
  1. 1 0
      apps/web-evals/next-env.d.ts
  2. 1 4
      apps/web-evals/next.config.ts
  3. 3 3
      apps/web-evals/package.json
  4. 3 3
      apps/web-roo-code/next.config.ts
  5. 14 14
      apps/web-roo-code/package.json
  6. 1 1
      apps/web-roo-code/src/app/cloud/page.tsx
  7. 1 1
      apps/web-roo-code/src/app/pr-fixer/content-a.tsx
  8. 1 1
      apps/web-roo-code/src/app/provider/page.tsx
  9. 1 1
      apps/web-roo-code/src/app/reviewer/content-b.ts
  10. 1 1
      apps/web-roo-code/src/app/reviewer/content.ts
  11. 28 13
      apps/web-roo-code/src/components/chromes/nav-bar.tsx
  12. 1 1
      apps/web-roo-code/src/components/homepage/features.tsx
  13. 1 1
      apps/web-roo-code/src/components/homepage/install-section.tsx
  14. 1 1
      apps/web-roo-code/src/components/homepage/testimonials.tsx
  15. 4 2
      apps/web-roo-code/src/components/homepage/use-examples-section.tsx
  16. 30 0
      apps/web-roo-code/src/images.d.ts
  17. 1 1
      packages/evals/src/cli/__tests__/messageLogDeduper.test.ts
  18. 4 4
      packages/evals/src/cli/index.ts
  19. 6 6
      packages/evals/src/cli/processTask.ts
  20. 3 3
      packages/evals/src/cli/runCi.ts
  21. 5 5
      packages/evals/src/cli/runEvals.ts
  22. 4 4
      packages/evals/src/cli/runTaskInCli.ts
  23. 5 5
      packages/evals/src/cli/runTaskInVscode.ts
  24. 3 3
      packages/evals/src/cli/runUnitTest.ts
  25. 2 2
      packages/evals/src/cli/types.ts
  26. 2 2
      packages/evals/src/cli/utils.ts
  27. 1 1
      packages/evals/src/db/db.ts
  28. 7 7
      packages/evals/src/db/index.ts
  29. 8 8
      packages/evals/src/db/queries/__tests__/copyRun.spec.ts
  30. 3 3
      packages/evals/src/db/queries/__tests__/runs.test.ts
  31. 3 3
      packages/evals/src/db/queries/copyRun.ts
  32. 6 6
      packages/evals/src/db/queries/runs.ts
  33. 4 4
      packages/evals/src/db/queries/taskMetrics.ts
  34. 5 5
      packages/evals/src/db/queries/tasks.ts
  35. 4 4
      packages/evals/src/db/queries/toolErrors.ts
  36. 1 1
      packages/evals/src/db/schema.ts
  37. 2 2
      packages/evals/src/index.ts
  38. 3 0
      packages/evals/tsconfig.json
  39. 333 174
      pnpm-lock.yaml

+ 1 - 0
apps/web-evals/next-env.d.ts

@@ -1,5 +1,6 @@
 /// <reference types="next" />
 /// <reference types="next/image-types/global" />
+import "./.next/dev/types/routes.d.ts"
 
 // NOTE: This file should not be edited
 // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

+ 1 - 4
apps/web-evals/next.config.ts

@@ -1,10 +1,7 @@
 import type { NextConfig } from "next"
 
 const nextConfig: NextConfig = {
-	webpack: (config) => {
-		config.resolve.extensionAlias = { ".js": [".ts", ".tsx", ".js", ".jsx"] }
-		return config
-	},
+	turbopack: {},
 }
 
 export default nextConfig

+ 3 - 3
apps/web-evals/package.json

@@ -3,7 +3,7 @@
 	"version": "0.0.0",
 	"type": "module",
 	"scripts": {
-		"lint": "next lint --max-warnings 0",
+		"lint": "eslint src --ext=ts,tsx --max-warnings=0",
 		"check-types": "tsc -b",
 		"dev": "scripts/check-services.sh && next dev -p 3446",
 		"format": "prettier --write src",
@@ -27,7 +27,7 @@
 		"@radix-ui/react-tabs": "^1.1.3",
 		"@radix-ui/react-tooltip": "^1.2.8",
 		"@roo-code/evals": "workspace:^",
-		"@roo-code/types": "workspace:^",
+		"@roo-code/types": "^1.108.0",
 		"@tanstack/react-query": "^5.69.0",
 		"archiver": "^7.0.1",
 		"class-variance-authority": "^0.7.1",
@@ -35,7 +35,7 @@
 		"cmdk": "^1.1.0",
 		"fuzzysort": "^3.1.0",
 		"lucide-react": "^0.518.0",
-		"next": "~15.2.8",
+		"next": "^16.1.6",
 		"next-themes": "^0.4.6",
 		"p-map": "^7.0.3",
 		"react": "^18.3.1",

+ 3 - 3
apps/web-roo-code/next.config.ts

@@ -1,9 +1,9 @@
+import path from "path"
 import type { NextConfig } from "next"
 
 const nextConfig: NextConfig = {
-	webpack: (config) => {
-		config.resolve.extensionAlias = { ".js": [".ts", ".tsx", ".js", ".jsx"] }
-		return config
+	turbopack: {
+		root: path.join(__dirname, "../.."),
 	},
 	async redirects() {
 		return [

+ 14 - 14
apps/web-roo-code/package.json

@@ -3,7 +3,7 @@
 	"version": "0.0.0",
 	"type": "module",
 	"scripts": {
-		"lint": "next lint --max-warnings 0",
+		"lint": "eslint src --ext=ts,tsx --max-warnings=0",
 		"check-types": "tsc --noEmit",
 		"dev": "next dev",
 		"build": "next build",
@@ -12,22 +12,22 @@
 		"clean": "rimraf .next .turbo"
 	},
 	"dependencies": {
-		"@radix-ui/react-dialog": "^1.1.14",
-		"@radix-ui/react-slot": "^1.2.3",
+		"@radix-ui/react-dialog": "^1.1.15",
+		"@radix-ui/react-slot": "^1.2.4",
 		"@roo-code/evals": "workspace:^",
-		"@roo-code/types": "workspace:^",
-		"@tanstack/react-query": "^5.79.0",
-		"@vercel/og": "^0.6.2",
+		"@roo-code/types": "^1.108.0",
+		"@tanstack/react-query": "^5.90.20",
+		"@vercel/og": "^0.8.6",
 		"class-variance-authority": "^0.7.1",
 		"clsx": "^2.1.1",
 		"embla-carousel-auto-scroll": "^8.6.0",
 		"embla-carousel-autoplay": "^8.6.0",
 		"embla-carousel-react": "^8.6.0",
-		"framer-motion": "12.15.0",
-		"lucide-react": "^0.518.0",
-		"next": "~15.2.8",
+		"framer-motion": "^12.29.2",
+		"lucide-react": "^0.563.0",
+		"next": "^16.1.6",
 		"next-themes": "^0.4.6",
-		"posthog-js": "^1.248.1",
+		"posthog-js": "^1.336.4",
 		"react": "^18.3.1",
 		"react-cookie-consent": "^9.0.0",
 		"react-dom": "^18.3.1",
@@ -36,7 +36,7 @@
 		"recharts": "^2.15.3",
 		"rehype-raw": "^7.0.0",
 		"remark-gfm": "^4.0.1",
-		"tailwind-merge": "^3.3.0",
+		"tailwind-merge": "^3.4.0",
 		"tailwindcss-animate": "^1.0.7",
 		"tldts": "^6.1.86",
 		"zod": "^3.25.61"
@@ -44,13 +44,13 @@
 	"devDependencies": {
 		"@roo-code/config-eslint": "workspace:^",
 		"@roo-code/config-typescript": "workspace:^",
-		"@tailwindcss/typography": "^0.5.16",
+		"@tailwindcss/typography": "^0.5.19",
 		"@types/node": "20.x",
 		"@types/react": "^18.3.23",
 		"@types/react-dom": "^18.3.7",
-		"autoprefixer": "^10.4.21",
+		"autoprefixer": "^10.4.23",
 		"next-sitemap": "^4.2.3",
-		"postcss": "^8.5.4",
+		"postcss": "^8.5.6",
 		"tailwindcss": "^3.4.17"
 	}
 }

+ 1 - 1
apps/web-roo-code/src/app/cloud/page.tsx

@@ -22,7 +22,7 @@ import { SEO } from "@/lib/seo"
 import { ogImageUrl } from "@/lib/og"
 import { EXTERNAL_LINKS } from "@/lib/constants"
 // Workaround for next/image choking on these for some reason
-import screenshotDark from "/public/heroes/cloud-screen.png"
+import screenshotDark from "../../../public/heroes/cloud-screen.png"
 
 const TITLE = "Roo Code Cloud"
 const DESCRIPTION =

+ 1 - 1
apps/web-roo-code/src/app/pr-fixer/content-a.tsx

@@ -2,7 +2,7 @@ import { type AgentPageContent } from "@/app/shared/agent-page-content"
 import Link from "next/link"
 
 // Workaround for next/image choking on these for some reason
-import hero from "/public/heroes/agent-pr-fixer.png"
+import hero from "../../../public/heroes/agent-pr-fixer.png"
 
 // Re-export for convenience
 export type { AgentPageContent }

+ 1 - 1
apps/web-roo-code/src/app/provider/page.tsx

@@ -252,7 +252,7 @@ export default function ProviderPage() {
 						{faqs.map((faq, index) => (
 							<div key={index} className="rounded-2xl border border-border bg-card p-6">
 								<h3 className="font-semibold">{faq.question}</h3>
-								<p className="mt-2 text-sm text-muted-foreground">{faq.answer}</p>
+								<div className="mt-2 text-sm text-muted-foreground">{faq.answer}</div>
 							</div>
 						))}
 					</div>

+ 1 - 1
apps/web-roo-code/src/app/reviewer/content-b.ts

@@ -1,7 +1,7 @@
 import { type AgentPageContent } from "@/app/shared/agent-page-content"
 
 // Workaround for next/image choking on these for some reason
-import hero from "/public/heroes/agent-reviewer.png"
+import hero from "../../../public/heroes/agent-reviewer.png"
 
 // Re-export for convenience
 export type { AgentPageContent }

+ 1 - 1
apps/web-roo-code/src/app/reviewer/content.ts

@@ -1,7 +1,7 @@
 import { type AgentPageContent } from "@/app/shared/agent-page-content"
 
 // Workaround for next/image choking on these for some reason
-import hero from "/public/heroes/agent-reviewer.png"
+import hero from "../../../public/heroes/agent-reviewer.png"
 
 // Re-export for convenience
 export type { AgentPageContent }

+ 28 - 13
apps/web-roo-code/src/components/chromes/nav-bar.tsx

@@ -30,6 +30,7 @@ interface NavBarProps {
 
 export function NavBar({ stars, downloads }: NavBarProps) {
 	const [isMenuOpen, setIsMenuOpen] = useState(false)
+	const [openDropdown, setOpenDropdown] = useState<string | null>(null)
 	const logoSrc = useLogoSrc()
 
 	return (
@@ -44,62 +45,76 @@ export function NavBar({ stars, downloads }: NavBarProps) {
 				{/* Desktop Navigation */}
 				<nav className="grow ml-6 hidden text-sm md:flex md:items-center">
 					{/* Product Dropdown */}
-					<div className="relative group">
+					<div
+						className="relative"
+						onMouseEnter={() => setOpenDropdown("product")}
+						onMouseLeave={() => setOpenDropdown(null)}>
 						<button className="flex items-center px-4 py-6 gap-1 transition-transform duration-200 hover:scale-105 hover:text-foreground">
 							Product
 							<ChevronDown className="size-3 ml-1 mt-0.5" />
 						</button>
-						<div className="absolute left-0 top-12 mt-2 w-[260px] rounded-md border border-border bg-background py-1 shadow-lg opacity-0 -translate-y-2 pointer-events-none group-hover:opacity-100 group-hover:translate-y-0 group-hover:pointer-events-auto transition-all duration-200">
+						<div
+							className={`absolute left-0 top-12 mt-2 w-[260px] rounded-md border border-border bg-background py-1 shadow-lg transition-all duration-200 ${openDropdown === "product" ? "opacity-100 translate-y-0 pointer-events-auto" : "opacity-0 -translate-y-2 pointer-events-none"}`}>
 							<Link
 								href="/extension"
-								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground">
+								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground"
+								onClick={() => setOpenDropdown(null)}>
 								<Puzzle className="size-3 inline mr-2 -mt-0.5" />
 								Roo Code VS Code Extension
 							</Link>
 							<Link
 								href="/cloud"
-								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground">
+								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground"
+								onClick={() => setOpenDropdown(null)}>
 								<Cloud className="size-3 inline mr-2 -mt-0.5" />
 								Roo Code Cloud
 							</Link>
 							<Link
 								href="/slack"
-								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground">
+								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground"
+								onClick={() => setOpenDropdown(null)}>
 								<Slack className="size-3 inline mr-2 -mt-0.5" />
 								Roo Code for Slack
 							</Link>
 							<Link
 								href="/linear"
-								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground">
+								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground"
+								onClick={() => setOpenDropdown(null)}>
 								<LinearIcon className="size-3 inline mr-2 -mt-0.5" />
 								Roo Code for Linear
 							</Link>
 							<Link
 								href="/provider"
-								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground">
+								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground"
+								onClick={() => setOpenDropdown(null)}>
 								<Brain className="size-3 inline mr-2 -mt-0.5" />
 								Roo Code Router
 							</Link>
 						</div>
 					</div>
 					{/* Resources Dropdown */}
-					<div className="relative group">
+					<div
+						className="relative"
+						onMouseEnter={() => setOpenDropdown("resources")}
+						onMouseLeave={() => setOpenDropdown(null)}>
 						<button className="flex items-center px-4 py-6 gap-1 transition-transform duration-200 hover:scale-105 hover:text-foreground">
 							Resources
 							<ChevronDown className="size-3 ml-1 mt-0.5" />
 						</button>
-						{/* Dropdown Menu */}
-						<div className="absolute left-0 top-12 mt-2 w-40 rounded-md border border-border bg-background py-1 shadow-lg opacity-0 -translate-y-2 pointer-events-none group-hover:opacity-100 group-hover:translate-y-0 group-hover:pointer-events-auto transition-all duration-200">
+						<div
+							className={`absolute left-0 top-12 mt-2 w-40 rounded-md border border-border bg-background py-1 shadow-lg transition-all duration-200 ${openDropdown === "resources" ? "opacity-100 translate-y-0 pointer-events-auto" : "opacity-0 -translate-y-2 pointer-events-none"}`}>
 							<Link
 								href="/evals"
-								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground">
+								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground"
+								onClick={() => setOpenDropdown(null)}>
 								Evals
 							</Link>
 							<a
 								href={EXTERNAL_LINKS.DISCORD}
 								target="_blank"
 								rel="noopener noreferrer"
-								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground">
+								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground"
+								onClick={() => setOpenDropdown(null)}>
 								Discord
 							</a>
 							<a
@@ -107,7 +122,7 @@ export function NavBar({ stars, downloads }: NavBarProps) {
 								target="_blank"
 								rel="noopener noreferrer"
 								className="block px-4 py-2 text-sm transition-colors hover:bg-accent hover:text-foreground"
-								onClick={() => setIsMenuOpen(false)}>
+								onClick={() => setOpenDropdown(null)}>
 								Trust Center
 							</a>
 						</div>

+ 1 - 1
apps/web-roo-code/src/components/homepage/features.tsx

@@ -92,7 +92,7 @@ export function Features() {
 			opacity: 1,
 			transition: {
 				duration: 1.2,
-				ease: "easeOut",
+				ease: "easeOut" as const,
 			},
 		},
 	}

+ 1 - 1
apps/web-roo-code/src/components/homepage/install-section.tsx

@@ -17,7 +17,7 @@ export function InstallSection({ downloads }: InstallSectionProps) {
 			opacity: 1,
 			transition: {
 				duration: 1.2,
-				ease: "easeOut",
+				ease: "easeOut" as const,
 			},
 		},
 	}

+ 1 - 1
apps/web-roo-code/src/components/homepage/testimonials.tsx

@@ -179,7 +179,7 @@ export function Testimonials() {
 			opacity: 1,
 			transition: {
 				duration: 0.6,
-				ease: [0.21, 0.45, 0.27, 0.9],
+				ease: [0.21, 0.45, 0.27, 0.9] as const,
 			},
 		},
 	}

+ 4 - 2
apps/web-roo-code/src/components/homepage/use-examples-section.tsx

@@ -41,6 +41,7 @@ interface PositionedUseCase extends UseCase {
 	scale: number
 	zIndex: number
 	avatar: string
+	width: number
 }
 
 const SOURCES = {
@@ -243,7 +244,7 @@ const LAYER_SCALES = {
 }
 
 function distributeItems(items: UseCase[]): PositionedUseCase[] {
-	const rng = seededRandom(Math.random() * 12345)
+	const rng = seededRandom(42)
 	const zones = { rows: 7, cols: 4 }
 	const zoneWidth = 100 / zones.cols
 	const zoneHeight = 100 / zones.rows
@@ -284,6 +285,7 @@ function distributeItems(items: UseCase[]): PositionedUseCase[] {
 			},
 			scale: LAYER_SCALES[layer],
 			zIndex: layer,
+			width: Math.round(300 + rng() * 100),
 		}
 	})
 }
@@ -345,7 +347,7 @@ function DesktopUseCaseCard({ item }: { item: PositionedUseCase }) {
 				left: `${item.position.x}%`,
 				top: `${item.position.y}%`,
 				zIndex: item.zIndex,
-				width: Math.round(300 + Math.random() * 100),
+				width: item.width,
 			}}
 			initial={{ opacity: 0, scale: 0 }}
 			whileInView={{

+ 30 - 0
apps/web-roo-code/src/images.d.ts

@@ -0,0 +1,30 @@
+declare module "*.png" {
+	const content: import("next/image").StaticImageData
+	export default content
+}
+
+declare module "*.jpg" {
+	const content: import("next/image").StaticImageData
+	export default content
+}
+
+declare module "*.jpeg" {
+	const content: import("next/image").StaticImageData
+	export default content
+}
+
+declare module "*.svg" {
+	// eslint-disable-next-line @typescript-eslint/no-explicit-any -- matches Next.js built-in SVG type to avoid conflicts with @svgr/webpack
+	const content: any
+	export default content
+}
+
+declare module "*.gif" {
+	const content: import("next/image").StaticImageData
+	export default content
+}
+
+declare module "*.webp" {
+	const content: import("next/image").StaticImageData
+	export default content
+}

+ 1 - 1
packages/evals/src/cli/__tests__/messageLogDeduper.test.ts

@@ -1,4 +1,4 @@
-import { MessageLogDeduper } from "../messageLogDeduper.js"
+import { MessageLogDeduper } from "../messageLogDeduper"
 
 describe("MessageLogDeduper", () => {
 	it("dedupes identical messages for same action+ts", () => {

+ 4 - 4
packages/evals/src/cli/index.ts

@@ -2,11 +2,11 @@ import * as fs from "fs"
 
 import { run, command, option, flag, number, boolean } from "cmd-ts"
 
-import { EVALS_REPO_PATH } from "../exercises/index.js"
+import { EVALS_REPO_PATH } from "../exercises/index"
 
-import { runCi } from "./runCi.js"
-import { runEvals } from "./runEvals.js"
-import { processTask } from "./processTask.js"
+import { runCi } from "./runCi"
+import { runEvals } from "./runEvals"
+import { processTask } from "./processTask"
 
 const main = async () => {
 	await run(

+ 6 - 6
packages/evals/src/cli/processTask.ts

@@ -2,13 +2,13 @@ import { execa } from "execa"
 
 import { type TaskEvent, RooCodeEventName } from "@roo-code/types"
 
-import { findRun, findTask, updateTask } from "../db/index.js"
+import { findRun, findTask, updateTask } from "../db/index"
 
-import { Logger, getTag, isDockerContainer } from "./utils.js"
-import { redisClient, getPubSubKey, registerRunner, deregisterRunner } from "./redis.js"
-import { runUnitTest } from "./runUnitTest.js"
-import { runTaskWithCli } from "./runTaskInCli.js"
-import { runTaskInVscode } from "./runTaskInVscode.js"
+import { Logger, getTag, isDockerContainer } from "./utils"
+import { redisClient, getPubSubKey, registerRunner, deregisterRunner } from "./redis"
+import { runUnitTest } from "./runUnitTest"
+import { runTaskWithCli } from "./runTaskInCli"
+import { runTaskInVscode } from "./runTaskInVscode"
 
 export const processTask = async ({
 	taskId,

+ 3 - 3
packages/evals/src/cli/runCi.ts

@@ -1,9 +1,9 @@
 import pMap from "p-map"
 
-import { EVALS_REPO_PATH, exerciseLanguages, getExercisesForLanguage } from "../exercises/index.js"
-import { createRun, createTask } from "../db/index.js"
+import { EVALS_REPO_PATH, exerciseLanguages, getExercisesForLanguage } from "../exercises/index"
+import { createRun, createTask } from "../db/index"
 
-import { runEvals } from "./runEvals.js"
+import { runEvals } from "./runEvals"
 
 export const runCi = async ({
 	concurrency = 1,

+ 5 - 5
packages/evals/src/cli/runEvals.ts

@@ -1,11 +1,11 @@
 import PQueue from "p-queue"
 
-import { findRun, finishRun, getTasks } from "../db/index.js"
-import { EVALS_REPO_PATH } from "../exercises/index.js"
+import { findRun, finishRun, getTasks } from "../db/index"
+import { EVALS_REPO_PATH } from "../exercises/index"
 
-import { Logger, getTag, isDockerContainer, resetEvalsRepo, commitEvalsRepoChanges } from "./utils.js"
-import { startHeartbeat, stopHeartbeat } from "./redis.js"
-import { processTask, processTaskInContainer } from "./processTask.js"
+import { Logger, getTag, isDockerContainer, resetEvalsRepo, commitEvalsRepoChanges } from "./utils"
+import { startHeartbeat, stopHeartbeat } from "./redis"
+import { processTask, processTaskInContainer } from "./processTask"
 
 export const runEvals = async (runId: number) => {
 	const run = await findRun(runId)

+ 4 - 4
packages/evals/src/cli/runTaskInCli.ts

@@ -7,11 +7,11 @@ import { execa } from "execa"
 import { type ToolUsage, TaskCommandName, RooCodeEventName, IpcMessageType } from "@roo-code/types"
 import { IpcClient } from "@roo-code/ipc"
 
-import { updateTask, createTaskMetrics, updateTaskMetrics, createToolError } from "../db/index.js"
-import { EVALS_REPO_PATH } from "../exercises/index.js"
+import { updateTask, createTaskMetrics, updateTaskMetrics, createToolError } from "../db/index"
+import { EVALS_REPO_PATH } from "../exercises/index"
 
-import { type RunTaskOptions } from "./types.js"
-import { mergeToolUsage, waitForSubprocessWithTimeout } from "./utils.js"
+import { type RunTaskOptions } from "./types"
+import { mergeToolUsage, waitForSubprocessWithTimeout } from "./utils"
 
 /**
  * Run a task using the Roo Code CLI (headless mode).

+ 5 - 5
packages/evals/src/cli/runTaskInVscode.ts

@@ -15,12 +15,12 @@ import {
 } from "@roo-code/types"
 import { IpcClient } from "@roo-code/ipc"
 
-import { updateTask, createTaskMetrics, updateTaskMetrics, createToolError } from "../db/index.js"
-import { EVALS_REPO_PATH } from "../exercises/index.js"
+import { updateTask, createTaskMetrics, updateTaskMetrics, createToolError } from "../db/index"
+import { EVALS_REPO_PATH } from "../exercises/index"
 
-import { type RunTaskOptions } from "./types.js"
-import { isDockerContainer, copyConversationHistory, mergeToolUsage, waitForSubprocessWithTimeout } from "./utils.js"
-import { MessageLogDeduper } from "./messageLogDeduper.js"
+import { type RunTaskOptions } from "./types"
+import { isDockerContainer, copyConversationHistory, mergeToolUsage, waitForSubprocessWithTimeout } from "./utils"
+import { MessageLogDeduper } from "./messageLogDeduper"
 
 export const runTaskInVscode = async ({ run, task, publish, logger, jobToken }: RunTaskOptions) => {
 	const { language, exercise } = task

+ 3 - 3
packages/evals/src/cli/runUnitTest.ts

@@ -3,10 +3,10 @@ import * as path from "path"
 import { execa, parseCommandString } from "execa"
 import psTree from "ps-tree"
 
-import type { Task } from "../db/index.js"
-import { type ExerciseLanguage, EVALS_REPO_PATH } from "../exercises/index.js"
+import type { Task } from "../db/index"
+import { type ExerciseLanguage, EVALS_REPO_PATH } from "../exercises/index"
 
-import { Logger } from "./utils.js"
+import { Logger } from "./utils"
 
 const UNIT_TEST_TIMEOUT = 2 * 60 * 1_000
 

+ 2 - 2
packages/evals/src/cli/types.ts

@@ -1,7 +1,7 @@
 import { type TaskEvent } from "@roo-code/types"
 
-import type { Run, Task } from "../db/index.js"
-import { Logger } from "./utils.js"
+import type { Run, Task } from "../db/index"
+import { Logger } from "./utils"
 
 export class SubprocessTimeoutError extends Error {
 	constructor(timeout: number) {

+ 2 - 2
packages/evals/src/cli/utils.ts

@@ -6,9 +6,9 @@ import { execa, type ResultPromise } from "execa"
 
 import type { ToolUsage } from "@roo-code/types"
 
-import type { Run, Task } from "../db/index.js"
+import type { Run, Task } from "../db/index"
 
-import { SubprocessTimeoutError } from "./types.js"
+import { SubprocessTimeoutError } from "./types"
 
 export const getTag = (caller: string, { run, task }: { run: Run; task?: Task }) =>
 	task

+ 1 - 1
packages/evals/src/db/db.ts

@@ -1,7 +1,7 @@
 import { drizzle } from "drizzle-orm/postgres-js"
 import postgres from "postgres"
 
-import * as schema from "./schema.js"
+import * as schema from "./schema"
 
 const pgClient = postgres(process.env.DATABASE_URL!, { prepare: false })
 const client = drizzle({ client: pgClient, schema })

+ 7 - 7
packages/evals/src/db/index.ts

@@ -1,9 +1,9 @@
-export * from "./schema.js"
+export * from "./schema"
 
-export * from "./queries/runs.js"
-export * from "./queries/tasks.js"
-export * from "./queries/taskMetrics.js"
-export * from "./queries/toolErrors.js"
-export * from "./queries/copyRun.js"
+export * from "./queries/runs"
+export * from "./queries/tasks"
+export * from "./queries/taskMetrics"
+export * from "./queries/toolErrors"
+export * from "./queries/copyRun"
 
-export * from "./db.js"
+export * from "./db"

+ 8 - 8
packages/evals/src/db/queries/__tests__/copyRun.spec.ts

@@ -2,14 +2,14 @@
 
 import { eq } from "drizzle-orm"
 
-import { copyRun } from "../copyRun.js"
-import { createRun } from "../runs.js"
-import { createTask } from "../tasks.js"
-import { createTaskMetrics } from "../taskMetrics.js"
-import { createToolError } from "../toolErrors.js"
-import { RecordNotFoundError } from "../errors.js"
-import { schema } from "../../schema.js"
-import { client as db } from "../../db.js"
+import { copyRun } from "../copyRun"
+import { createRun } from "../runs"
+import { createTask } from "../tasks"
+import { createTaskMetrics } from "../taskMetrics"
+import { createToolError } from "../toolErrors"
+import { RecordNotFoundError } from "../errors"
+import { schema } from "../../schema"
+import { client as db } from "../../db"
 
 describe("copyRun", () => {
 	let sourceRunId: number

+ 3 - 3
packages/evals/src/db/queries/__tests__/runs.test.ts

@@ -1,6 +1,6 @@
-import { createRun, finishRun } from "../runs.js"
-import { createTask } from "../tasks.js"
-import { createTaskMetrics } from "../taskMetrics.js"
+import { createRun, finishRun } from "../runs"
+import { createTask } from "../tasks"
+import { createTaskMetrics } from "../taskMetrics"
 
 describe("finishRun", () => {
 	it("aggregates task metrics, including tool usage", async () => {

+ 3 - 3
packages/evals/src/db/queries/copyRun.ts

@@ -1,10 +1,10 @@
 import { eq } from "drizzle-orm"
 import type { NodePgDatabase } from "drizzle-orm/node-postgres"
 
-import type { InsertRun, InsertTask, InsertTaskMetrics, InsertToolError } from "../schema.js"
-import { schema } from "../schema.js"
+import type { InsertRun, InsertTask, InsertTaskMetrics, InsertToolError } from "../schema"
+import { schema } from "../schema"
 
-import { RecordNotFoundError, RecordNotCreatedError } from "./errors.js"
+import { RecordNotFoundError, RecordNotCreatedError } from "./errors"
 
 export const copyRun = async ({
 	sourceDb,

+ 6 - 6
packages/evals/src/db/queries/runs.ts

@@ -2,12 +2,12 @@ import { desc, eq, inArray, sql, sum } from "drizzle-orm"
 
 import type { ToolUsage } from "@roo-code/types"
 
-import { RecordNotFoundError, RecordNotCreatedError } from "./errors.js"
-import type { InsertRun, UpdateRun } from "../schema.js"
-import { schema } from "../schema.js"
-import { client as db } from "../db.js"
-import { createTaskMetrics } from "./taskMetrics.js"
-import { getTasks } from "./tasks.js"
+import { RecordNotFoundError, RecordNotCreatedError } from "./errors"
+import type { InsertRun, UpdateRun } from "../schema"
+import { schema } from "../schema"
+import { client as db } from "../db"
+import { createTaskMetrics } from "./taskMetrics"
+import { getTasks } from "./tasks"
 
 export const findRun = async (id: number) => {
 	const run = await db.query.runs.findFirst({ where: eq(schema.runs.id, id) })

+ 4 - 4
packages/evals/src/db/queries/taskMetrics.ts

@@ -1,9 +1,9 @@
 import { eq } from "drizzle-orm"
 
-import { RecordNotFoundError, RecordNotCreatedError } from "./errors.js"
-import type { InsertTaskMetrics, UpdateTaskMetrics } from "../schema.js"
-import { taskMetrics } from "../schema.js"
-import { client as db } from "../db.js"
+import { RecordNotFoundError, RecordNotCreatedError } from "./errors"
+import type { InsertTaskMetrics, UpdateTaskMetrics } from "../schema"
+import { taskMetrics } from "../schema"
+import { client as db } from "../db"
 
 export const findTaskMetrics = async (id: number) => {
 	const run = await db.query.taskMetrics.findFirst({ where: eq(taskMetrics.id, id) })

+ 5 - 5
packages/evals/src/db/queries/tasks.ts

@@ -1,11 +1,11 @@
 import { and, asc, eq, sql } from "drizzle-orm"
 
-import type { ExerciseLanguage } from "../../exercises/index.js"
+import type { ExerciseLanguage } from "../../exercises/index"
 
-import { RecordNotFoundError, RecordNotCreatedError } from "./errors.js"
-import type { InsertTask, UpdateTask } from "../schema.js"
-import { tasks } from "../schema.js"
-import { client as db } from "../db.js"
+import { RecordNotFoundError, RecordNotCreatedError } from "./errors"
+import type { InsertTask, UpdateTask } from "../schema"
+import { tasks } from "../schema"
+import { client as db } from "../db"
 
 export const findTask = async (id: number) => {
 	const run = await db.query.tasks.findFirst({ where: eq(tasks.id, id) })

+ 4 - 4
packages/evals/src/db/queries/toolErrors.ts

@@ -1,7 +1,7 @@
-import { RecordNotCreatedError } from "./errors.js"
-import type { InsertToolError } from "../schema.js"
-import { toolErrors } from "../schema.js"
-import { client as db } from "../db.js"
+import { RecordNotCreatedError } from "./errors"
+import type { InsertToolError } from "../schema"
+import { toolErrors } from "../schema"
+import { client as db } from "../db"
 
 export const createToolError = async (args: InsertToolError) => {
 	const records = await db

+ 1 - 1
packages/evals/src/db/schema.ts

@@ -3,7 +3,7 @@ import { relations } from "drizzle-orm"
 
 import type { RooCodeSettings, ToolName, ToolUsage } from "@roo-code/types"
 
-import type { ExerciseLanguage } from "../exercises/index.js"
+import type { ExerciseLanguage } from "../exercises/index"
 
 /**
  * ExecutionMethod

+ 2 - 2
packages/evals/src/index.ts

@@ -1,2 +1,2 @@
-export * from "./db/index.js"
-export * from "./exercises/index.js"
+export * from "./db"
+export * from "./exercises"

+ 3 - 0
packages/evals/tsconfig.json

@@ -1,6 +1,9 @@
 {
 	"extends": "@roo-code/config-typescript/base.json",
 	"compilerOptions": {
+		"module": "ESNext",
+		"moduleResolution": "bundler",
+		"noEmit": true,
 		"types": ["vitest/globals"]
 	},
 	"include": ["src", "drizzle.config.ts", "vitest-global-setup.ts"],

File diff ditekan karena terlalu besar
+ 333 - 174
pnpm-lock.yaml


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini