Skip to content

Commit ce912be

Browse files
committed
Update github stars
1 parent 8156bed commit ce912be

File tree

1,563 files changed

+1589
-373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,563 files changed

+1589
-373
lines changed

apps/svelte.dev/scripts/registry/npm.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,15 @@ export class PackageCache {
173173
await fsp.writeFile(pathname, PackageCache.stringify(data));
174174
}
175175

176+
static async delete(pkg_name: string) {
177+
const pathname = path.resolve(
178+
path.dirname(fileURLToPath(import.meta.url)),
179+
`../../src/lib/server/generated/registry/${PackageCache.#clean_name(pkg_name)}.md`
180+
);
181+
182+
await fsp.unlink(pathname);
183+
}
184+
176185
static async *entries() {
177186
const cache_dir = path.resolve(
178187
path.dirname(fileURLToPath(import.meta.url)),

apps/svelte.dev/scripts/registry/update-registry.ts

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,9 @@ async function process_batches_through_llm({
289289

290290
if (!package_details) continue;
291291

292-
package_details.meta.tags = json[pkg_name].tags;
292+
package_details.meta.tags = json[pkg_name].tags ?? [];
293+
294+
if (package_details.meta.tags.length === 0) continue;
293295

294296
// If LLM provided a new description, use it
295297
if (json[pkg_name].description) {
@@ -351,8 +353,8 @@ async function process_batches_through_llm({
351353
// If this is the top-level call (not a retry), filter and return only Svelte packages
352354
if (retry_count === 0) {
353355
// Filter out packages that didn't get LLM details (non-Svelte packages)
354-
const svelte_packages = new Map<string, any>();
355-
const non_svelte_packages = new Map<string, any>();
356+
const svelte_packages = new Map<string, StructuredInterimPackage>();
357+
const non_svelte_packages = new Map<string, StructuredInterimPackage>();
356358

357359
for (const [pkg_name, pkg_data] of packages_map) {
358360
console.log(pkg_data.meta.tags, pkg_data.meta.description);
@@ -402,35 +404,33 @@ export async function fetch_github_stars(repo_url: string): Promise<number | nul
402404
// GitHub API URL to fetch repository data
403405
let api_url = `https://api.github.com/repos/${owner}/${repo}`;
404406

405-
return request_queue.enqueue(async () => {
406-
try {
407-
console.log(`Fetching stars for ${owner}/${repo}`);
408-
const response = await superfetch(api_url, {
409-
headers: {
410-
...HEADERS,
411-
Accept: 'application/vnd.github.v3+json',
412-
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`
413-
}
414-
});
415-
416-
if (response.status === 404) {
417-
console.log(`404 Not Found for ${api_url} (Not retrying)`);
418-
return null;
407+
try {
408+
console.log(`Fetching stars for ${owner}/${repo}`);
409+
const response = await superfetch(api_url, {
410+
headers: {
411+
...HEADERS,
412+
Accept: 'application/vnd.github.v3+json',
413+
Authorization: `Bearer ${process.env.GITHUB_TOKEN}`
419414
}
415+
});
420416

421-
const data = await response.json();
417+
if (response.status === 404) {
418+
console.log(`404 Not Found for ${api_url} (Not retrying)`);
419+
return null;
420+
}
422421

423-
if (!data || typeof data.stargazers_count !== 'number') {
424-
console.error(`Invalid response from GitHub API for ${repo_url}`);
425-
return null;
426-
}
422+
const data = await response.json();
427423

428-
return data.stargazers_count;
429-
} catch (error) {
430-
console.error(`Error fetching stars for ${repo_url}:`, error);
424+
if (!data || typeof data.stargazers_count !== 'number') {
425+
console.error(`Invalid response from GitHub API for ${repo_url}`);
431426
return null;
432427
}
433-
});
428+
429+
return data.stargazers_count;
430+
} catch (error) {
431+
console.error(`Error fetching stars for ${repo_url}:`, error);
432+
return null;
433+
}
434434
}
435435

436436
async function update_all_github_stars(ignore_if_exists = false) {
@@ -465,6 +465,14 @@ async function update_cache_from_npm() {
465465
console.log(detail.versions[latestVersion]);
466466
}
467467

468+
async function delete_untagged() {
469+
for await (const [pkg_name_file, data] of PackageCache.entries()) {
470+
if (!Array.isArray(data.tags)) {
471+
PackageCache.delete(data.name);
472+
}
473+
}
474+
}
475+
468476
/**
469477
* Creates a generator that yields batches from a Map
470478
*/
@@ -481,6 +489,8 @@ async function* create_map_batch_generator(
481489
}
482490
}
483491

484-
const svelte_packages = await process_batches_through_llm();
492+
// const svelte_packages = await process_batches_through_llm();
485493

486494
// update_cache_from_npm();
495+
update_all_github_stars();
496+
// delete_untagged();

apps/svelte.dev/src/lib/server/generated/registry/0mn1-svelte-adapter-appengine.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ author: "Jonas Jongejan"
66
homepage: "https://github.com/halfdanj/svelte-adapter-appengine#readme"
77
downloads: 2
88
updated: "2022-06-02T17:02:30.869Z"
9+
github_stars: 69
910
tags:
1011
- adapter
1112
---

apps/svelte.dev/src/lib/server/generated/registry/a-luna-svelte-simple-tables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ author: "Aaron Luna"
66
homepage: "https://github.com/a-luna/svelte-simple-tables"
77
downloads: 27
88
updated: "2022-07-19T09:27:18.684Z"
9+
github_stars: 6
910
tags:
1011
- component-library
1112
- ui

apps/svelte.dev/src/lib/server/generated/registry/abbychau-svelma.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ author: "Abby Chau, Brian Hann"
66
homepage: "https://github.com/c0bra/svelma#readme"
77
downloads: 2
88
updated: "2021-03-17T17:12:53.189Z"
9+
github_stars: 5
910
tags:
1011
- component-library
1112
- ui

apps/svelte.dev/src/lib/server/generated/registry/accuser-breakpoint.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ author: "Matthew Gibbons"
66
homepage: "https://github.com/accuser/svelte-tailwindcss-breakpoint/README.md"
77
downloads: 2
88
updated: "2022-08-31T20:48:53.134Z"
9+
github_stars: 1
910
tags:
1011
- utility
1112
---

apps/svelte.dev/src/lib/server/generated/registry/accuser-svelte-markdown-gfm.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ repo_url: "https://github.com/accuser/svelte-markdown-gfm"
55
author: "Matthew Gibbons"
66
homepage: "https://github.com/accuser/svelte-markdown-gfm"
77
updated: "2024-09-30T08:49:03.326Z"
8+
github_stars: 1
89
tags:
910
- content
1011
---

apps/svelte.dev/src/lib/server/generated/registry/accuser-svelte-plausible-analytics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ author: "Matthew Gibbons"
66
homepage: "https://github.com/accuser/svelte-plausible-analytics/README.md"
77
downloads: 435
88
updated: "2023-12-21T16:57:09.707Z"
9+
github_stars: 15
910
tags:
1011
- integration
1112
- utility

apps/svelte.dev/src/lib/server/generated/registry/accuser-svelte-store-array.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ author: "Matthew Gibbons"
66
homepage: "https://github.com/accuser/svelte-store-array/README.md"
77
downloads: 2
88
updated: "2022-10-24T05:29:38.856Z"
9+
github_stars: 10
910
tags:
1011
- utility
1112
---

apps/svelte.dev/src/lib/server/generated/registry/actus-svelte.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ author: "Oskar Hane"
66
homepage: "https://github.com/oskarhane/actus#readme"
77
downloads: 4
88
updated: "2022-01-10T12:50:48.342Z"
9+
github_stars: 51
910
tags:
1011
- ui
1112
- component-library

0 commit comments

Comments
 (0)