claude-code-templates 1.14.6 → 1.14.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-templates",
3
- "version": "1.14.6",
3
+ "version": "1.14.7",
4
4
  "description": "CLI tool to setup Claude Code configurations with framework-specific commands, automation hooks and MCP Servers for your projects",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -22,9 +22,8 @@ class TrackingService {
22
22
  return false;
23
23
  }
24
24
 
25
- // Temporarily disable tracking until we fix the endpoint
26
- // TODO: Re-enable when tracking endpoint is working
27
- return false;
25
+ // Enable public telemetry tracking
26
+ return true;
28
27
  }
29
28
 
30
29
  /**
@@ -84,46 +83,43 @@ class TrackingService {
84
83
  }
85
84
 
86
85
  /**
87
- * Send tracking data to Vercel serverless function (anonymous)
86
+ * Send tracking data via public telemetry endpoint (like Google Analytics)
88
87
  */
89
88
  async sendTrackingData(trackingData) {
90
89
  const controller = new AbortController();
91
90
  const timeoutId = setTimeout(() => controller.abort(), this.timeout);
92
91
 
93
92
  try {
94
- // Use Vercel serverless function (no auth needed)
95
- const response = await fetch('https://vercel-tracking-mj8fcml40-daniel-avilas-projects-2d322e1e.vercel.app/api/track', {
96
- method: 'POST',
97
- headers: {
98
- 'Content-Type': 'application/json',
99
- 'User-Agent': 'claude-code-templates-cli'
100
- },
101
- body: JSON.stringify({
102
- component_type: trackingData.component_type,
103
- component_name: trackingData.component_name,
104
- timestamp: trackingData.timestamp,
105
- session_id: trackingData.session_id,
106
- environment: trackingData.environment,
107
- metadata: trackingData.metadata || {}
108
- }),
93
+ // Build query parameters for GET request (like image tracking)
94
+ const params = new URLSearchParams({
95
+ type: trackingData.component_type,
96
+ name: trackingData.component_name,
97
+ platform: trackingData.environment.platform || 'unknown',
98
+ cli: trackingData.environment.cli_version || 'unknown',
99
+ session: trackingData.session_id.substring(0, 8) // Only first 8 chars for privacy
100
+ });
101
+
102
+ // Use public telemetry endpoint (no auth needed, returns GIF)
103
+ await fetch(`https://vercel-tracking-m1wrh55ev-daniel-avilas-projects-2d322e1e.vercel.app/api/telemetry?${params}`, {
104
+ method: 'GET',
105
+ mode: 'no-cors', // Prevents CORS errors
109
106
  signal: controller.signal
110
107
  });
111
108
 
112
109
  clearTimeout(timeoutId);
113
110
 
114
- if (!response.ok) {
115
- const errorText = await response.text();
116
- throw new Error(`Tracking API responded with ${response.status}: ${errorText}`);
117
- }
118
-
111
+ // No need to check response with no-cors mode
119
112
  // Only show success message when debugging
120
113
  if (process.env.CCT_DEBUG === 'true') {
121
- console.debug('📊 Download tracked successfully via Vercel function');
114
+ console.debug('📊 Download tracked successfully via telemetry');
122
115
  }
123
116
 
124
117
  } catch (error) {
125
118
  clearTimeout(timeoutId);
126
- throw error;
119
+ // Silent fail - tracking should never break user experience
120
+ if (process.env.CCT_DEBUG === 'true') {
121
+ console.debug('📊 Tracking failed (non-critical):', error.message);
122
+ }
127
123
  }
128
124
  }
129
125