diff --git a/package.json b/package.json index 018ba29..da87442 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codesight", - "version": "1.14.0", + "version": "1.14.0-emerge.0", "description": "See your codebase clearly. Universal AI context generator that maps routes, schema, components, dependencies, and more for Claude Code, Cursor, Copilot, Codex, and any AI coding tool.", "main": "dist/index.js", "bin": { diff --git a/src/detectors/components.ts b/src/detectors/components.ts index a47e770..94978fd 100644 --- a/src/detectors/components.ts +++ b/src/detectors/components.ts @@ -63,9 +63,13 @@ const UI_PRIMITIVES = new Set([ function isUIPrimitive(filePath: string): boolean { const name = basename(filePath, extname(filePath)).toLowerCase(); + // Note: do NOT match a bare `/ui/` segment here. That collides with monorepo + // workspaces literally named `ui/` (e.g. `ui/src/components/*.tsx`), where + // every custom component would be wrongly filtered. The real shadcn case is + // `components/ui/` (caught below) or lowercase primitive filenames (caught + // via UI_PRIMITIVES). Vendor paths (`@radix-ui`, `@shadcn`) are kept. return ( UI_PRIMITIVES.has(name) || - filePath.includes("/ui/") || filePath.includes("/components/ui/") || filePath.includes("@radix-ui") || filePath.includes("@shadcn") diff --git a/src/plugins/terraform/file-collector.ts b/src/plugins/terraform/file-collector.ts index 4241c5a..4c12915 100644 --- a/src/plugins/terraform/file-collector.ts +++ b/src/plugins/terraform/file-collector.ts @@ -1,5 +1,5 @@ import { readdir, readFile, stat } from "node:fs/promises"; -import { join, dirname, resolve, extname } from "node:path"; +import { join, resolve, extname } from "node:path"; import type { TerraformPluginConfig } from "./types.js"; const SKIP_DIRS = new Set([".terraform", ".git", "node_modules", ".terragrunt-cache"]); @@ -12,7 +12,7 @@ export interface CollectedFiles { /** * Collect .tf and .tfvars files from the best-matching infrastructure location. - * Tries: explicit config path → in-project subdirs → sibling repos → project root. + * Tries: explicit config path → in-project subdirs (terraform/, infra/, etc.) → project root. */ export async function collectTfFiles( projectRoot: string, @@ -32,15 +32,7 @@ export async function collectTfFiles( if (files.tfFiles.length > 0) return files; } - // 3. Sibling infrastructure repo - const parent = dirname(projectRoot); - for (const sibling of ["infrastructure", "infra", "terraform", "deploy"]) { - const candidate = join(parent, sibling); - const files = await scanDirForTf(candidate); - if (files.tfFiles.length > 0) return files; - } - - // 4. .tf files at project root + // 3. .tf files at project root const rootFiles = await scanDirForTf(projectRoot, 1); if (rootFiles.tfFiles.length > 0) return rootFiles; diff --git a/src/plugins/terraform/index.ts b/src/plugins/terraform/index.ts index ce26eec..db1cf93 100644 --- a/src/plugins/terraform/index.ts +++ b/src/plugins/terraform/index.ts @@ -12,19 +12,19 @@ export type { TerraformPluginConfig } from "./types.js"; /** * Create a Terraform infrastructure plugin for codesight. * - * Scans .tf files — either co-located in the project or in a separate - * infrastructure repo — and generates an infrastructure section with - * deployment context for AI agents. + * Scans .tf files co-located in the project (terraform/, infra/, etc.) and generates + * an infrastructure section with deployment context for AI agents. + * Use infraPath to point at a separate infrastructure repository. * * @example - * // Auto-discover infrastructure + * // Auto-discover co-located terraform * createTerraformPlugin() * * @example - * // Explicit centralised infra repo + * // Explicit separate infra repo * createTerraformPlugin({ * infraPath: '../infrastructure', - * serviceName: 'query-service', + * serviceName: 'my-service', * }) */ export function createTerraformPlugin(config: TerraformPluginConfig = {}): CodesightPlugin { diff --git a/src/plugins/terraform/types.ts b/src/plugins/terraform/types.ts index f8efffa..99bbb4a 100644 --- a/src/plugins/terraform/types.ts +++ b/src/plugins/terraform/types.ts @@ -1,7 +1,7 @@ /** User-facing configuration for the Terraform infrastructure plugin */ export interface TerraformPluginConfig { - /** Path to infra repo — absolute or relative to project root. - * Default: auto-discovers ../infrastructure, ./terraform, ./infra, ./deploy */ + /** Path to a separate infrastructure repo — absolute or relative to project root. + * Default: auto-discovers ./terraform, ./infra, ./infrastructure, ./deploy, ./iac */ infraPath?: string; /** Override service name matching (default: project.name from package.json etc.) */ serviceName?: string; diff --git a/tests/detectors.test.ts b/tests/detectors.test.ts index 857828f..593fec2 100644 --- a/tests/detectors.test.ts +++ b/tests/detectors.test.ts @@ -371,6 +371,43 @@ describe("Component Detection", async () => { assert.ok(components.length >= 2); assert.ok(components.some((c: any) => c.name === "UserProfile" && c.props.includes("name"))); }); + + it("detects components in a workspace named `ui/` without filtering them as shadcn primitives", async () => { + // Regression: a bare `/ui/` segment in the file path used to trigger the + // shadcn-primitive filter, which wrongly dropped every custom component + // in monorepos whose UI package is literally named `ui/` (e.g. morgan). + // The real shadcn case lives at `components/ui/.tsx` and is + // still filtered here. + const dir = await writeFixture("ui-workspace-app", { + "package.json": JSON.stringify({ name: "root", private: true }), + "pnpm-workspace.yaml": "packages:\n - ui\n", + "ui/package.json": JSON.stringify({ + name: "@app/ui", + dependencies: { react: "^19.0.0" }, + }), + // Custom app component inside the `ui` workspace. PascalCase name, so + // the UI_PRIMITIVES filename filter must not catch it either. + "ui/src/components/AppShell.tsx": `interface AppShellProps { children: React.ReactNode; width?: "default" | "narrow" } +const AppShell = ({ children, width = "default" }: AppShellProps) => { + return
{children}
; +}; +export default AppShell;`, + // shadcn primitive at the canonical path. Must still be filtered. + "ui/src/components/ui/button.tsx": `export const Button = ({ label }: { label: string }) => ;`, + }); + const project = await mods.detectProject(dir); + assert.equal(project.componentFramework, "react", "react workspace dep should be aggregated"); + const files = await mods.collectFiles(dir); + const components = await mods.detectComponents(files, project); + assert.ok( + components.some((c: any) => c.name === "AppShell"), + `expected AppShell to be detected, got: ${components.map((c: any) => c.name).join(", ") || ""}`, + ); + assert.ok( + !components.some((c: any) => c.name === "Button"), + "shadcn primitive at components/ui/button.tsx should still be filtered", + ); + }); }); // =================== DEPENDENCY GRAPH TESTS =================== diff --git a/tests/fixtures/config-app/.env.example b/tests/fixtures/config-app/.env.example deleted file mode 100644 index 7d4c260..0000000 --- a/tests/fixtures/config-app/.env.example +++ /dev/null @@ -1,3 +0,0 @@ -DATABASE_URL= -JWT_SECRET= -PORT=3000 \ No newline at end of file diff --git a/tests/fixtures/config-app/package.json b/tests/fixtures/config-app/package.json deleted file mode 100644 index 357e8e2..0000000 --- a/tests/fixtures/config-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test"} \ No newline at end of file diff --git a/tests/fixtures/config-app/src/config.ts b/tests/fixtures/config-app/src/config.ts deleted file mode 100644 index b77bec6..0000000 --- a/tests/fixtures/config-app/src/config.ts +++ /dev/null @@ -1,2 +0,0 @@ -const db = process.env.DATABASE_URL; -const port = process.env.PORT || 3000; \ No newline at end of file diff --git a/tests/fixtures/django-app/requirements.txt b/tests/fixtures/django-app/requirements.txt deleted file mode 100644 index d3e4ba5..0000000 --- a/tests/fixtures/django-app/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -django diff --git a/tests/fixtures/django-app/urls.py b/tests/fixtures/django-app/urls.py deleted file mode 100644 index e0aa979..0000000 --- a/tests/fixtures/django-app/urls.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.urls import path -urlpatterns = [ - path("api/users/", views.UserList.as_view()), - path("api/users//", views.UserDetail.as_view()), -] \ No newline at end of file diff --git a/tests/fixtures/drizzle-schema/package.json b/tests/fixtures/drizzle-schema/package.json deleted file mode 100644 index 2ab8dea..0000000 --- a/tests/fixtures/drizzle-schema/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"drizzle-orm":"^0.30.0"}} \ No newline at end of file diff --git a/tests/fixtures/drizzle-schema/src/schema.ts b/tests/fixtures/drizzle-schema/src/schema.ts deleted file mode 100644 index ee270d4..0000000 --- a/tests/fixtures/drizzle-schema/src/schema.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { pgTable, text, uuid, timestamp, boolean } from "drizzle-orm/pg-core"; -export const users = pgTable("users", { - id: uuid("id").primaryKey().defaultRandom(), - email: text("email").notNull().unique(), - name: text("name").notNull(), - active: boolean("active").default(true), -}); -export const posts = pgTable("posts", { - id: uuid("id").primaryKey().defaultRandom(), - title: text("title").notNull(), - userId: uuid("user_id").references(() => users.id), -}); \ No newline at end of file diff --git a/tests/fixtures/elysia-app/package.json b/tests/fixtures/elysia-app/package.json deleted file mode 100644 index dd7bf2e..0000000 --- a/tests/fixtures/elysia-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"elysia":"^1.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/elysia-app/src/index.ts b/tests/fixtures/elysia-app/src/index.ts deleted file mode 100644 index c3335fc..0000000 --- a/tests/fixtures/elysia-app/src/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Elysia } from "elysia"; -const app = new Elysia() - .get("/api/health", () => "ok") - .post("/api/items", () => ({ created: true })); \ No newline at end of file diff --git a/tests/fixtures/elysia-detect/package.json b/tests/fixtures/elysia-detect/package.json deleted file mode 100644 index dd7bf2e..0000000 --- a/tests/fixtures/elysia-detect/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"elysia":"^1.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/express-app/package.json b/tests/fixtures/express-app/package.json deleted file mode 100644 index 749d35e..0000000 --- a/tests/fixtures/express-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"express":"^4.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/express-app/src/routes.ts b/tests/fixtures/express-app/src/routes.ts deleted file mode 100644 index ef853b4..0000000 --- a/tests/fixtures/express-app/src/routes.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Router } from "express"; -const router = Router(); -router.get("/users", (req, res) => res.json([])); -router.post("/users", (req, res) => res.json({})); -router.delete("/users/:id", (req, res) => res.json({})); -export default router; \ No newline at end of file diff --git a/tests/fixtures/fastapi-app/main.py b/tests/fixtures/fastapi-app/main.py deleted file mode 100644 index 87fecc8..0000000 --- a/tests/fixtures/fastapi-app/main.py +++ /dev/null @@ -1,8 +0,0 @@ -from fastapi import FastAPI -app = FastAPI() -@app.get("/users") -def get_users(): - return [] -@app.post("/users") -def create_user(): - return {} \ No newline at end of file diff --git a/tests/fixtures/fastapi-app/requirements.txt b/tests/fixtures/fastapi-app/requirements.txt deleted file mode 100644 index 97dc7cd..0000000 --- a/tests/fixtures/fastapi-app/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -fastapi -uvicorn diff --git a/tests/fixtures/fastify-app/package.json b/tests/fixtures/fastify-app/package.json deleted file mode 100644 index 9de5a5c..0000000 --- a/tests/fixtures/fastify-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"fastify":"^4.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/fastify-app/src/server.ts b/tests/fixtures/fastify-app/src/server.ts deleted file mode 100644 index b4d96d8..0000000 --- a/tests/fixtures/fastify-app/src/server.ts +++ /dev/null @@ -1,5 +0,0 @@ -import fastify from "fastify"; -const app = fastify(); -app.get("/health", async () => ({ status: "ok" })); -app.post("/items", async (req) => ({ created: true })); -export default app; \ No newline at end of file diff --git a/tests/fixtures/graph-app/package.json b/tests/fixtures/graph-app/package.json deleted file mode 100644 index aff692f..0000000 --- a/tests/fixtures/graph-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"hono":"^4.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/graph-app/src/auth.ts b/tests/fixtures/graph-app/src/auth.ts deleted file mode 100644 index e1b5ffb..0000000 --- a/tests/fixtures/graph-app/src/auth.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { db } from "./db.js"; -export const auth = {}; \ No newline at end of file diff --git a/tests/fixtures/graph-app/src/db.ts b/tests/fixtures/graph-app/src/db.ts deleted file mode 100644 index 04cb237..0000000 --- a/tests/fixtures/graph-app/src/db.ts +++ /dev/null @@ -1 +0,0 @@ -export const db = {}; \ No newline at end of file diff --git a/tests/fixtures/graph-app/src/middleware.ts b/tests/fixtures/graph-app/src/middleware.ts deleted file mode 100644 index 81996f7..0000000 --- a/tests/fixtures/graph-app/src/middleware.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { auth } from "./auth.js"; -import { db } from "./db.js"; -export const mw = {}; \ No newline at end of file diff --git a/tests/fixtures/graph-app/src/routes.ts b/tests/fixtures/graph-app/src/routes.ts deleted file mode 100644 index 2cf61c9..0000000 --- a/tests/fixtures/graph-app/src/routes.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { db } from "./db.js"; -import { auth } from "./auth.js"; -export const routes = {}; \ No newline at end of file diff --git a/tests/fixtures/hono-app/package.json b/tests/fixtures/hono-app/package.json deleted file mode 100644 index aff692f..0000000 --- a/tests/fixtures/hono-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"hono":"^4.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/hono-app/src/index.ts b/tests/fixtures/hono-app/src/index.ts deleted file mode 100644 index 9a2b542..0000000 --- a/tests/fixtures/hono-app/src/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Hono } from "hono"; -const app = new Hono(); -app.get("/api/users", (c) => c.json([])); -app.post("/api/users", (c) => c.json({})); -app.get("/api/users/:id", (c) => c.json({})); -export default app; \ No newline at end of file diff --git a/tests/fixtures/js-imports/package.json b/tests/fixtures/js-imports/package.json deleted file mode 100644 index 357e8e2..0000000 --- a/tests/fixtures/js-imports/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test"} \ No newline at end of file diff --git a/tests/fixtures/js-imports/src/main.ts b/tests/fixtures/js-imports/src/main.ts deleted file mode 100644 index 33086b3..0000000 --- a/tests/fixtures/js-imports/src/main.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { helper } from "./utils.js"; -console.log(helper); \ No newline at end of file diff --git a/tests/fixtures/js-imports/src/utils.ts b/tests/fixtures/js-imports/src/utils.ts deleted file mode 100644 index 94ec3e1..0000000 --- a/tests/fixtures/js-imports/src/utils.ts +++ /dev/null @@ -1 +0,0 @@ -export const helper = () => {}; \ No newline at end of file diff --git a/tests/fixtures/middleware-app/package.json b/tests/fixtures/middleware-app/package.json deleted file mode 100644 index 749d35e..0000000 --- a/tests/fixtures/middleware-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"express":"^4.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/middleware-app/src/middleware/auth.ts b/tests/fixtures/middleware-app/src/middleware/auth.ts deleted file mode 100644 index 700ee2c..0000000 --- a/tests/fixtures/middleware-app/src/middleware/auth.ts +++ /dev/null @@ -1,5 +0,0 @@ -export function authMiddleware(req, res, next) { - const token = req.headers.authorization; - if (!token) return res.status(401).json({ error: "unauthorized" }); - next(); -} \ No newline at end of file diff --git a/tests/fixtures/middleware-app/src/middleware/rate-limit.ts b/tests/fixtures/middleware-app/src/middleware/rate-limit.ts deleted file mode 100644 index 0874422..0000000 --- a/tests/fixtures/middleware-app/src/middleware/rate-limit.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function rateLimiter(req, res, next) { - // rate limiting logic - next(); -} \ No newline at end of file diff --git a/tests/fixtures/monorepo-detect/package.json b/tests/fixtures/monorepo-detect/package.json deleted file mode 100644 index 950e109..0000000 --- a/tests/fixtures/monorepo-detect/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","workspaces":["packages/*"]} \ No newline at end of file diff --git a/tests/fixtures/monorepo-detect/packages/api/package.json b/tests/fixtures/monorepo-detect/packages/api/package.json deleted file mode 100644 index 018378c..0000000 --- a/tests/fixtures/monorepo-detect/packages/api/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"@test/api","dependencies":{"hono":"^4.0.0","drizzle-orm":"^0.30.0"}} \ No newline at end of file diff --git a/tests/fixtures/monorepo-detect/packages/web/package.json b/tests/fixtures/monorepo-detect/packages/web/package.json deleted file mode 100644 index 7224562..0000000 --- a/tests/fixtures/monorepo-detect/packages/web/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"@test/web","dependencies":{"react":"^18.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/nestjs-app/package.json b/tests/fixtures/nestjs-app/package.json deleted file mode 100644 index 7672715..0000000 --- a/tests/fixtures/nestjs-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"@nestjs/core":"^10.0.0","@nestjs/common":"^10.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/nestjs-app/src/users.controller.ts b/tests/fixtures/nestjs-app/src/users.controller.ts deleted file mode 100644 index e3cd6dc..0000000 --- a/tests/fixtures/nestjs-app/src/users.controller.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Controller, Get, Post, Put, Delete, Param } from '@nestjs/common'; -@Controller('users') -export class UsersController { - @Get() - findAll() { return []; } - @Get(':id') - findOne(@Param('id') id: string) { return {}; } - @Post() - create() { return {}; } - @Delete(':id') - remove(@Param('id') id: string) { return {}; } -} \ No newline at end of file diff --git a/tests/fixtures/nestjs-detect/package.json b/tests/fixtures/nestjs-detect/package.json deleted file mode 100644 index 7672715..0000000 --- a/tests/fixtures/nestjs-detect/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"@nestjs/core":"^10.0.0","@nestjs/common":"^10.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/next-app/package.json b/tests/fixtures/next-app/package.json deleted file mode 100644 index afd7a24..0000000 --- a/tests/fixtures/next-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"next":"^14.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/next-app/src/app/api/users/route.ts b/tests/fixtures/next-app/src/app/api/users/route.ts deleted file mode 100644 index 0590ffa..0000000 --- a/tests/fixtures/next-app/src/app/api/users/route.ts +++ /dev/null @@ -1,6 +0,0 @@ -export async function GET() { - return Response.json([]); -} -export async function POST(request: Request) { - return Response.json({}); -} \ No newline at end of file diff --git a/tests/fixtures/nuxt-app/package.json b/tests/fixtures/nuxt-app/package.json deleted file mode 100644 index 8ed5126..0000000 --- a/tests/fixtures/nuxt-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"nuxt":"^3.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/nuxt-app/server/api/users.get.ts b/tests/fixtures/nuxt-app/server/api/users.get.ts deleted file mode 100644 index 355792e..0000000 --- a/tests/fixtures/nuxt-app/server/api/users.get.ts +++ /dev/null @@ -1 +0,0 @@ -export default defineEventHandler(() => []); \ No newline at end of file diff --git a/tests/fixtures/nuxt-app/server/api/users.post.ts b/tests/fixtures/nuxt-app/server/api/users.post.ts deleted file mode 100644 index 3a5224b..0000000 --- a/tests/fixtures/nuxt-app/server/api/users.post.ts +++ /dev/null @@ -1 +0,0 @@ -export default defineEventHandler(() => ({})); \ No newline at end of file diff --git a/tests/fixtures/nuxt-app/server/api/users/[id].get.ts b/tests/fixtures/nuxt-app/server/api/users/[id].get.ts deleted file mode 100644 index 3a5224b..0000000 --- a/tests/fixtures/nuxt-app/server/api/users/[id].get.ts +++ /dev/null @@ -1 +0,0 @@ -export default defineEventHandler(() => ({})); \ No newline at end of file diff --git a/tests/fixtures/nuxt-detect/package.json b/tests/fixtures/nuxt-detect/package.json deleted file mode 100644 index 8ed5126..0000000 --- a/tests/fixtures/nuxt-detect/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"nuxt":"^3.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/prisma-schema/package.json b/tests/fixtures/prisma-schema/package.json deleted file mode 100644 index dca7c60..0000000 --- a/tests/fixtures/prisma-schema/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"prisma":"^5.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/prisma-schema/prisma/schema.prisma b/tests/fixtures/prisma-schema/prisma/schema.prisma deleted file mode 100644 index 00ab729..0000000 --- a/tests/fixtures/prisma-schema/prisma/schema.prisma +++ /dev/null @@ -1,12 +0,0 @@ -model User { - id String @id @default(cuid()) - email String @unique - name String - posts Post[] -} -model Post { - id String @id @default(cuid()) - title String - userId String - user User @relation(fields: [userId], references: [id]) -} \ No newline at end of file diff --git a/tests/fixtures/raw-http-app/package.json b/tests/fixtures/raw-http-app/package.json deleted file mode 100644 index 357e8e2..0000000 --- a/tests/fixtures/raw-http-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test"} \ No newline at end of file diff --git a/tests/fixtures/raw-http-app/src/server.ts b/tests/fixtures/raw-http-app/src/server.ts deleted file mode 100644 index 57e0722..0000000 --- a/tests/fixtures/raw-http-app/src/server.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { createServer } from "http"; -const server = createServer((req, res) => { - const url = new URL(req.url!, "http://localhost").pathname; - if (url === "/health") { res.end("ok"); return; } - if (url === "/api/users" && req.method === "GET") { res.end("[]"); return; } - if (url === "/api/users" && req.method === "POST") { res.end("{}"); return; } -}); \ No newline at end of file diff --git a/tests/fixtures/react-app/package.json b/tests/fixtures/react-app/package.json deleted file mode 100644 index c8cacbf..0000000 --- a/tests/fixtures/react-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"react":"^18.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/react-app/src/ProjectCard.tsx b/tests/fixtures/react-app/src/ProjectCard.tsx deleted file mode 100644 index 8f1567f..0000000 --- a/tests/fixtures/react-app/src/ProjectCard.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export const ProjectCard = ({ title, description }: { title: string; description: string }) => { - return

{title}

{description}

; -}; \ No newline at end of file diff --git a/tests/fixtures/react-app/src/UserProfile.tsx b/tests/fixtures/react-app/src/UserProfile.tsx deleted file mode 100644 index e4e45bf..0000000 --- a/tests/fixtures/react-app/src/UserProfile.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function UserProfile({ name, email, avatar }: { name: string; email: string; avatar?: string }) { - return
{name} - {email}
; -} \ No newline at end of file diff --git a/tests/fixtures/remix-app/app/routes/users.tsx b/tests/fixtures/remix-app/app/routes/users.tsx deleted file mode 100644 index 510aae2..0000000 --- a/tests/fixtures/remix-app/app/routes/users.tsx +++ /dev/null @@ -1,6 +0,0 @@ -export async function loader({ request }) { - return json([]); -} -export async function action({ request }) { - return json({}); -} \ No newline at end of file diff --git a/tests/fixtures/remix-app/package.json b/tests/fixtures/remix-app/package.json deleted file mode 100644 index 44f75e3..0000000 --- a/tests/fixtures/remix-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"@remix-run/node":"^2.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/remix-detect/package.json b/tests/fixtures/remix-detect/package.json deleted file mode 100644 index 44f75e3..0000000 --- a/tests/fixtures/remix-detect/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"@remix-run/node":"^2.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/sveltekit-app/package.json b/tests/fixtures/sveltekit-app/package.json deleted file mode 100644 index f48cdce..0000000 --- a/tests/fixtures/sveltekit-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"@sveltejs/kit":"^2.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/sveltekit-app/src/routes/api/users/+server.ts b/tests/fixtures/sveltekit-app/src/routes/api/users/+server.ts deleted file mode 100644 index 834b1fe..0000000 --- a/tests/fixtures/sveltekit-app/src/routes/api/users/+server.ts +++ /dev/null @@ -1,6 +0,0 @@ -export async function GET() { - return new Response(JSON.stringify([]), { headers: { 'content-type': 'application/json' } }); -} -export async function POST({ request }) { - return new Response(JSON.stringify({})); -} \ No newline at end of file diff --git a/tests/fixtures/sveltekit-detect/package.json b/tests/fixtures/sveltekit-detect/package.json deleted file mode 100644 index f48cdce..0000000 --- a/tests/fixtures/sveltekit-detect/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"@sveltejs/kit":"^2.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/trpc-app/package.json b/tests/fixtures/trpc-app/package.json deleted file mode 100644 index 1a434da..0000000 --- a/tests/fixtures/trpc-app/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"@trpc/server":"^10.0.0"}} \ No newline at end of file diff --git a/tests/fixtures/trpc-app/src/router.ts b/tests/fixtures/trpc-app/src/router.ts deleted file mode 100644 index 3d56729..0000000 --- a/tests/fixtures/trpc-app/src/router.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { publicProcedure, createTRPCRouter } from "./trpc"; -export const userRouter = createTRPCRouter({ - list: publicProcedure.query(async () => []), - create: publicProcedure.input(z.object({ name: z.string() })).mutation(async ({ input }) => ({})), - getById: publicProcedure.input(z.object({ id: z.string() })).query(async ({ input }) => ({})), -}); \ No newline at end of file diff --git a/tests/fixtures/trpc-detect/package.json b/tests/fixtures/trpc-detect/package.json deleted file mode 100644 index 1a434da..0000000 --- a/tests/fixtures/trpc-detect/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"test","dependencies":{"@trpc/server":"^10.0.0"}} \ No newline at end of file