mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
Update Next.js hint and simplify analytics code
This commit is contained in:
5
.changeset/metal-eels-end.md
Normal file
5
.changeset/metal-eels-end.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"create-better-t-stack": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
update nextjs backend hint
|
||||||
@@ -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,
|
||||||
|
|||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user