Skip to content

Commit 705253e

Browse files
ericyangpanclaude
andcommitted
refactor(data): move GitHub stars to centralized data directory
Relocate github-stars.json from manifests/ to a new data/ directory to better separate dynamic data from static product manifests. Changes: - Create data/ directory for runtime data storage - Move github-stars.json from manifests/ to data/ - Update fetch-github-stars.mjs to write to new location - Update generate-manifest-indexes.mjs to read from new location - Change github-stars.ts to use JSON import instead of inlined data This separation improves the project structure by distinguishing between static manifest metadata and dynamically fetched data. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f03ccef commit 705253e

File tree

4 files changed

+9
-50
lines changed

4 files changed

+9
-50
lines changed
File renamed without changes.

scripts/fetch-github-stars.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const __dirname = dirname(__filename);
1313
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
1414

1515
// Path to the centralized GitHub stars data file
16-
const GITHUB_STARS_FILE = path.join(__dirname, '..', 'manifests', 'github-stars.json');
16+
const GITHUB_STARS_FILE = path.join(__dirname, '..', 'data', 'github-stars.json');
1717

1818
// Directories configuration - now pointing to individual file directories
1919
const dirsConfig = [
@@ -244,7 +244,7 @@ async function main() {
244244
// Write the updated stars data to file
245245
try {
246246
fs.writeFileSync(GITHUB_STARS_FILE, JSON.stringify(starsData, null, 2) + '\n', 'utf8');
247-
console.log('\n📝 Successfully updated manifests/github-stars.json');
247+
console.log('\n📝 Successfully updated data/github-stars.json');
248248
} catch (error) {
249249
console.error('\n❌ Failed to write github-stars.json:', error.message);
250250
process.exit(1);

scripts/generate-manifest-indexes.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ ${exports}
157157
* Generate GitHub stars TypeScript file from centralized JSON
158158
*/
159159
function generateGithubStarsFile() {
160-
const githubStarsPath = path.join(MANIFESTS_DIR, 'github-stars.json');
160+
const githubStarsPath = path.join(__dirname, '..', 'data', 'github-stars.json');
161161

162162
if (!fs.existsSync(githubStarsPath)) {
163163
console.log('⚠ github-stars.json not found, skipping stars generation');
@@ -172,9 +172,11 @@ function generateGithubStarsFile() {
172172
* Do not edit manually - run the script to regenerate
173173
*/
174174
175+
import githubStarsJson from '../../../data/github-stars.json';
176+
175177
export type GithubStarsData = Record<string, Record<string, number | null>>;
176178
177-
export const githubStarsData: GithubStarsData = ${JSON.stringify(starsData, null, 2)};
179+
export const githubStarsData = githubStarsJson as GithubStarsData;
178180
179181
/**
180182
* Get GitHub stars for a specific product

src/lib/generated/github-stars.ts

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,11 @@
44
* Do not edit manually - run the script to regenerate
55
*/
66

7+
import githubStarsJson from '../../../data/github-stars.json';
8+
79
export type GithubStarsData = Record<string, Record<string, number | null>>;
810

9-
export const githubStarsData: GithubStarsData = {
10-
"extensions": {
11-
"amp": null,
12-
"augment-code": null,
13-
"claude-code": 42,
14-
"cline": 52.3,
15-
"continue": 29.8,
16-
"github-copilot": null,
17-
"jetbrains-junie": null,
18-
"kilo-code": 12.2,
19-
"roo-code": 20.7,
20-
"tabnine": 10.8
21-
},
22-
"clis": {
23-
"amazon-q-developer-cli": 1.8,
24-
"amp-cli": null,
25-
"augment-code-cli": 0.1,
26-
"claude-code": 42,
27-
"cline-cli": null,
28-
"codebuddy-cli": null,
29-
"codex": 50.2,
30-
"continue-cli": 29.8,
31-
"droid-cli": null,
32-
"gemini-cli": 82.1,
33-
"github-copilot-cli": 5,
34-
"kimi-cli": 2.6,
35-
"kilocode-cli": 12.2,
36-
"kode": 3.4,
37-
"neovate-code": 1,
38-
"opencode": 32.4,
39-
"qoder-cli": null
40-
},
41-
"ides": {
42-
"codebuddy": null,
43-
"codeflicker": null,
44-
"cursor": 31.6,
45-
"droid": null,
46-
"intellij-idea": 19.1,
47-
"kiro": 2.2,
48-
"qoder": null,
49-
"trae": null,
50-
"vscode": 178.4,
51-
"windsurf": null,
52-
"zed": 69.5
53-
}
54-
};
11+
export const githubStarsData = githubStarsJson as GithubStarsData;
5512

5613
/**
5714
* Get GitHub stars for a specific product

0 commit comments

Comments
 (0)