Skip to content

Commit 7a78bbf

Browse files
committed
restructuring the json file
1 parent a3df6b5 commit 7a78bbf

File tree

2 files changed

+94
-29
lines changed

2 files changed

+94
-29
lines changed

.github/workflows/update-readme.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- restructure
78

89
permissions:
910
contents: write
@@ -85,13 +86,18 @@ jobs:
8586
8687
// Generate official starter kits list with sorting by installs
8788
const officialKits = [];
88-
for (const [name, repo] of Object.entries(templates.official)) {
89-
const packageData = await getPackageData(repo);
89+
for (const kit of templates.official) {
90+
const packageData = await getPackageData(kit.package);
9091
// Ensure installs is a number for proper sorting
9192
const installs = packageData && packageData.package && packageData.package.downloads ?
9293
parseInt(packageData.package.downloads.total, 10) : 0;
93-
officialKits.push({ name, repo, installs });
94-
console.log(`Added official kit: ${name}, installs: ${installs}`);
94+
officialKits.push({
95+
title: kit.title,
96+
package: kit.package,
97+
repo: kit.repo,
98+
installs: installs
99+
});
100+
console.log(`Added official kit: ${kit.title}, package: ${kit.package}, repo: ${kit.repo}, installs: ${installs}`);
95101
}
96102
97103
// Sort official kits by installs (descending)
@@ -101,18 +107,23 @@ jobs:
101107
// Generate the formatted list
102108
let officialList = '';
103109
for (const kit of officialKits) {
104-
officialList += `- [${kit.name}](https://github.com/${kit.repo}) - \`${kit.repo}\` - 💿 ${formatNumber(kit.installs)} installs\n`;
110+
officialList += `- [${kit.title}](https://github.com/${kit.repo}) - \`${kit.package}\` - 💿 ${formatNumber(kit.installs)} installs\n`;
105111
}
106112
107113
// Generate community starter kits list with sorting by installs
108114
const communityKits = [];
109-
for (const [name, repo] of Object.entries(templates.community)) {
110-
const packageData = await getPackageData(repo);
115+
for (const kit of templates.community) {
116+
const packageData = await getPackageData(kit.package);
111117
// Ensure installs is a number for proper sorting
112118
const installs = packageData && packageData.package && packageData.package.downloads ?
113119
parseInt(packageData.package.downloads.total, 10) : 0;
114-
communityKits.push({ name, repo, installs });
115-
console.log(`Added community kit: ${name}, installs: ${installs}`);
120+
communityKits.push({
121+
title: kit.title,
122+
package: kit.package,
123+
repo: kit.repo,
124+
installs: installs
125+
});
126+
console.log(`Added community kit: ${kit.title}, package: ${kit.package}, repo: ${kit.repo}, installs: ${installs}`);
116127
}
117128
118129
// Sort community kits by installs (descending)
@@ -122,7 +133,7 @@ jobs:
122133
// Generate the formatted list
123134
let communityList = '';
124135
for (const kit of communityKits) {
125-
communityList += `- [${kit.name}](https://github.com/${kit.repo}) - \`${kit.repo}\` - 💾 ${formatNumber(kit.installs)} installs\n`;
136+
communityList += `- [${kit.title}](https://github.com/${kit.repo}) - \`${kit.package}\` - 💾 ${formatNumber(kit.installs)} installs\n`;
126137
}
127138
128139
// Replace placeholders in README

templates.json

Lines changed: 73 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,74 @@
11
{
2-
"official": {
3-
"React": "laravel/react-starter-kit",
4-
"Vue": "laravel/vue-starter-kit",
5-
"Livewire": "laravel/livewire-starter-kit"
6-
},
7-
"community": {
8-
"Statamic": "statamic/statamic",
9-
"Cachet": "cachethq/cachet",
10-
"Svelte": "oseughu/svelte-starter-kit",
11-
"Wave": "devdojo/wave",
12-
"Genesis": "devdojo/genesis",
13-
"Filament": "tnylea/filamentapp",
14-
"Livewire Starter": "tnylea/livewire-starter",
15-
"Larasonic React": "shipfastlabs/larasonic-react",
16-
"Larasonic Vue": "shipfastlabs/larasonic-vue",
17-
"TALL starters": "mortenebak/tallstarter",
18-
"Filament Zeus starters": "lara-zeus/zeus"
19-
}
20-
}
2+
"official": [{
3+
"title": "React",
4+
"package": "laravel/react-starter-kit",
5+
"repo": "laravel/react-starter-kit"
6+
},
7+
{
8+
"title": "Vue",
9+
"package": "laravel/vue-starter-kit",
10+
"repo": "laravel/vue-starter-kit"
11+
},
12+
{
13+
"title": "Livewire",
14+
"package": "laravel/livewire-starter-kit",
15+
"repo": "laravel/livewire-starter-kit"
16+
}
17+
],
18+
"community": [{
19+
"title": "Statamic",
20+
"package": "statamic/statamic",
21+
"repo": "statamic/statamic"
22+
},
23+
{
24+
"title": "Cachet",
25+
"package": "cachethq/cachet",
26+
"repo": "cachethq/cachet"
27+
},
28+
{
29+
"title": "Svelte",
30+
"package": "oseughu/svelte-starter-kit",
31+
"repo": "oseughu/svelte-starter-kit"
32+
},
33+
{
34+
"title": "Wave",
35+
"package": "devdojo/wave",
36+
"repo": "thedevdojo/wave"
37+
},
38+
{
39+
"title": "Genesis",
40+
"package": "devdojo/genesis",
41+
"repo": "thedevdojo/genesis"
42+
},
43+
{
44+
"title": "Filament",
45+
"package": "tnylea/filamentapp",
46+
"repo": "tnylea/filamentapp"
47+
},
48+
{
49+
"title": "Livewire Starter",
50+
"package": "tnylea/livewire-starter",
51+
"repo": "tnylea/livewire-starter"
52+
},
53+
{
54+
"title": "Larasonic React",
55+
"package": "shipfastlabs/larasonic-react",
56+
"repo": "shipfastlabs/larasonic-react"
57+
},
58+
{
59+
"title": "Larasonic Vue",
60+
"package": "shipfastlabs/larasonic-vue",
61+
"repo": "shipfastlabs/larasonic-vue"
62+
},
63+
{
64+
"title": "TALL starters",
65+
"package": "mortenebak/tallstarter",
66+
"repo": "mortenebak/tallstarter"
67+
},
68+
{
69+
"title": "Filament Zeus starters",
70+
"package": "lara-zeus/zeus",
71+
"repo": "lara-zeus/zeus"
72+
}
73+
]
74+
}

0 commit comments

Comments
 (0)