Update Next.js hint and simplify analytics code

This commit is contained in:
Aman Varshney
2025-05-29 09:23:07 +05:30
parent c3180b2e31
commit c5c3fa3a7b
3 changed files with 9 additions and 7 deletions

View File

@@ -0,0 +1,5 @@
---
"create-better-t-stack": patch
---
update nextjs backend hint

View File

@@ -26,7 +26,7 @@ export async function getBackendFrameworkChoice(
{ {
value: "next" as const, value: "next" as const,
label: "Next.js", label: "Next.js",
hint: "Nextjs API routes", hint: "separate api routes only backend",
}, },
{ {
value: "express" as const, value: "express" as const,

View File

@@ -1,4 +1,3 @@
import consola from "consola";
import { PostHog } from "posthog-node"; import { PostHog } from "posthog-node";
import type { ProjectConfig } from "../types"; import type { ProjectConfig } from "../types";
import { getLatestCLIVersion } from "./get-latest-cli-version"; import { getLatestCLIVersion } from "./get-latest-cli-version";
@@ -18,9 +17,7 @@ export async function trackProjectCreation(
}); });
try { try {
const sessionId = `cli_${Date.now()}_${crypto const sessionId = `cli_${crypto.randomUUID().replace(/-/g, "")}`;
.randomUUID()
.replace(/-/g, "")}`;
const { projectName, projectDir, relativePath, ...safeConfig } = config; const { projectName, projectDir, relativePath, ...safeConfig } = config;
@@ -35,8 +32,8 @@ export async function trackProjectCreation(
$ip: null, $ip: null,
}, },
}); });
} catch (error) { } catch (_error) {
consola.debug("Analytics tracking failed:", error); // consola.debug("Analytics tracking failed:", error);
} finally { } finally {
await posthog.shutdown(); await posthog.shutdown();
} }