create-better-t-stack 2.29.1 → 2.29.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +20 -24
  2. package/package.json +1 -2
package/dist/index.js CHANGED
@@ -7,7 +7,6 @@ import z from "zod";
7
7
  import path from "node:path";
8
8
  import fs from "fs-extra";
9
9
  import { fileURLToPath } from "node:url";
10
- import { PostHog } from "posthog-node";
11
10
  import gradient from "gradient-string";
12
11
  import * as JSONC from "jsonc-parser";
13
12
  import { $, execa } from "execa";
@@ -1136,31 +1135,28 @@ function isTelemetryEnabled() {
1136
1135
  const POSTHOG_API_KEY = "phc_8ZUxEwwfKMajJLvxz1daGd931dYbQrwKNficBmsdIrs";
1137
1136
  const POSTHOG_HOST = "https://us.i.posthog.com";
1138
1137
  async function trackProjectCreation(config) {
1139
- const posthog = new PostHog(POSTHOG_API_KEY, {
1140
- host: POSTHOG_HOST,
1141
- flushAt: 1,
1142
- flushInterval: 0,
1143
- privacyMode: true,
1144
- disableGeoip: true,
1145
- disabled: !isTelemetryEnabled()
1146
- });
1138
+ if (!isTelemetryEnabled()) return;
1139
+ const sessionId = `cli_${crypto.randomUUID().replace(/-/g, "")}`;
1140
+ const { projectName, projectDir, relativePath,...safeConfig } = config;
1141
+ const payload = {
1142
+ api_key: POSTHOG_API_KEY,
1143
+ event: "project_created",
1144
+ properties: {
1145
+ ...safeConfig,
1146
+ cli_version: getLatestCLIVersion(),
1147
+ node_version: process.version,
1148
+ platform: process.platform,
1149
+ $ip: null
1150
+ },
1151
+ distinct_id: sessionId
1152
+ };
1147
1153
  try {
1148
- const sessionId = `cli_${crypto.randomUUID().replace(/-/g, "")}`;
1149
- const { projectName, projectDir, relativePath,...safeConfig } = config;
1150
- posthog.capture({
1151
- distinctId: sessionId,
1152
- event: "project_created",
1153
- properties: {
1154
- ...safeConfig,
1155
- cli_version: getLatestCLIVersion(),
1156
- node_version: process.version,
1157
- platform: process.platform,
1158
- $ip: null
1159
- }
1154
+ await fetch(`${POSTHOG_HOST}/capture`, {
1155
+ method: "POST",
1156
+ headers: { "Content-Type": "application/json" },
1157
+ body: JSON.stringify(payload)
1160
1158
  });
1161
- } catch (_error) {} finally {
1162
- await posthog.shutdown();
1163
- }
1159
+ } catch (_error) {}
1164
1160
  }
1165
1161
 
1166
1162
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-better-t-stack",
3
- "version": "2.29.1",
3
+ "version": "2.29.2",
4
4
  "description": "A modern CLI tool for scaffolding end-to-end type-safe TypeScript projects with best practices and customizable configurations",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -62,7 +62,6 @@
62
62
  "handlebars": "^4.7.8",
63
63
  "jsonc-parser": "^3.3.1",
64
64
  "picocolors": "^1.1.1",
65
- "posthog-node": "^5.6.0",
66
65
  "trpc-cli": "^0.10.2",
67
66
  "ts-morph": "^26.0.0",
68
67
  "zod": "^4.0.14"