refactor: move telemetry to single package (#5152)

This commit is contained in:
Alex Yang
2025-10-07 12:08:19 -07:00
committed by GitHub
parent 6f2f29a96e
commit 613747ef8e
21 changed files with 150 additions and 22 deletions

View File

@@ -0,0 +1,23 @@
import { getPackageVersion } from "../utils/package-json";
const FRAMEWORKS: Record<string, string> = {
next: "next",
nuxt: "nuxt",
"@remix-run/server-runtime": "remix",
astro: "astro",
"@sveltejs/kit": "sveltekit",
"solid-start": "solid-start",
"tanstack-start": "tanstack-start",
hono: "hono",
express: "express",
elysia: "elysia",
expo: "expo",
};
export async function detectFramework() {
for (const [pkg, name] of Object.entries(FRAMEWORKS)) {
const version = await getPackageVersion(pkg);
if (version) return { name, version };
}
return undefined;
}