claude-code-templates 1.14.3 → 1.14.4
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 +1 -1
- package/src/tracking-service.js +20 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-templates",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.4",
|
|
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": {
|
package/src/tracking-service.js
CHANGED
|
@@ -83,37 +83,36 @@ class TrackingService {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
|
-
* Send tracking data
|
|
86
|
+
* Send tracking data via GitHub Repository Dispatch (anonymous)
|
|
87
87
|
*/
|
|
88
88
|
async sendTrackingData(trackingData) {
|
|
89
|
-
const title = `📊 ${trackingData.component_type}:${trackingData.component_name} - ${trackingData.timestamp.split('T')[0]}`;
|
|
90
|
-
|
|
91
|
-
const body = `\`\`\`json
|
|
92
|
-
${JSON.stringify(trackingData, null, 2)}
|
|
93
|
-
\`\`\`
|
|
94
|
-
|
|
95
|
-
<!-- ANALYTICS_DATA -->
|
|
96
|
-
Component: **${trackingData.component_name}** (${trackingData.component_type})
|
|
97
|
-
Platform: ${trackingData.environment.platform} ${trackingData.environment.arch}
|
|
98
|
-
Node: ${trackingData.environment.node_version}
|
|
99
|
-
CLI: ${trackingData.environment.cli_version}
|
|
100
|
-
Session: \`${trackingData.session_id}\`
|
|
101
|
-
`;
|
|
102
|
-
|
|
103
89
|
const controller = new AbortController();
|
|
104
90
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
105
91
|
|
|
106
92
|
try {
|
|
107
|
-
|
|
93
|
+
// Use GitHub Repository Dispatch API (public endpoint, no auth needed)
|
|
94
|
+
const response = await fetch(`https://api.github.com/repos/${this.repoOwner}/${this.repoName}/dispatches`, {
|
|
108
95
|
method: 'POST',
|
|
109
96
|
headers: {
|
|
110
97
|
'Content-Type': 'application/json',
|
|
98
|
+
'Accept': 'application/vnd.github.v3+json',
|
|
111
99
|
'User-Agent': 'claude-code-templates-cli'
|
|
112
100
|
},
|
|
113
101
|
body: JSON.stringify({
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
102
|
+
event_type: 'component_download',
|
|
103
|
+
client_payload: {
|
|
104
|
+
component_type: trackingData.component_type,
|
|
105
|
+
component_name: trackingData.component_name,
|
|
106
|
+
timestamp: trackingData.timestamp,
|
|
107
|
+
session_id: trackingData.session_id,
|
|
108
|
+
environment: {
|
|
109
|
+
platform: trackingData.environment.platform,
|
|
110
|
+
arch: trackingData.environment.arch,
|
|
111
|
+
node_version: trackingData.environment.node_version,
|
|
112
|
+
cli_version: trackingData.environment.cli_version
|
|
113
|
+
},
|
|
114
|
+
metadata: trackingData.metadata || {}
|
|
115
|
+
}
|
|
117
116
|
}),
|
|
118
117
|
signal: controller.signal
|
|
119
118
|
});
|
|
@@ -121,12 +120,12 @@ Session: \`${trackingData.session_id}\`
|
|
|
121
120
|
clearTimeout(timeoutId);
|
|
122
121
|
|
|
123
122
|
if (!response.ok) {
|
|
124
|
-
throw new Error(`GitHub API responded with ${response.status}`);
|
|
123
|
+
throw new Error(`GitHub Dispatch API responded with ${response.status}`);
|
|
125
124
|
}
|
|
126
125
|
|
|
127
126
|
// Only show success message when debugging
|
|
128
127
|
if (process.env.CCT_DEBUG === 'true') {
|
|
129
|
-
console.debug('📊 Download tracked successfully');
|
|
128
|
+
console.debug('📊 Download tracked successfully via repository dispatch');
|
|
130
129
|
}
|
|
131
130
|
|
|
132
131
|
} catch (error) {
|