Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update script to paginate request + init stars #436

Merged
merged 7 commits into from
Aug 13, 2023

Conversation

MacFJA
Copy link
Collaborator

@MacFJA MacFJA commented Aug 13, 2023

  • Script:
    • Update the script to paginate request to avoid timeout from GitHub API.
    • Sort result to ease stars file review and merge
  • Provide a base stars count for all repos

@netlify
Copy link

netlify bot commented Aug 13, 2023

Deploy Preview for sveltesociety-preview ready!

Name Link
🔨 Latest commit 2e49841
🔍 Latest deploy log https://app.netlify.com/sites/sveltesociety-preview/deploys/64d90369be85c800087735a6
😎 Deploy Preview https://deploy-preview-436--sveltesociety-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@MacFJA MacFJA requested a review from benmccann August 13, 2023 16:17
@MacFJA
Copy link
Collaborator Author

MacFJA commented Aug 13, 2023

@MacFJA stars have disappeared from a lot of projects on https://sveltesociety.dev/components. I think it happened when I merged this PR. Maybe you could take a look?

(from #217 (comment))

2 issues here:

@benmccann benmccann merged commit b197b8d into svelte-society:main Aug 13, 2023
5 checks passed
@benmccann
Copy link
Collaborator

thank you!!

@MacFJA MacFJA deleted the init-stars branch August 13, 2023 16:25
@benmccann
Copy link
Collaborator

Thanks for this @MacFJA!

We're getting closer, but I noticed a couple issues remaining. One was that it doesn't handle any repositories that have been renamed yet (e.g. the username changed or the repo was transferred to a GitHub org). I went ahead and updated the .json files manually to take care of those for now. However, there's still one issue left, which is that it's not working for any that have a URL that's not the GitHub URL. E.g. if you load https://sveltesociety.dev/components then the first one showing is overmind-svelte with a URL of https://overmindjs.org/. I think it's nice that we can link to homepages, but maybe we should change the existing url field to something like repository and then add a new optional url field where we can put any homepages that are different from the source code URL.

@MacFJA
Copy link
Collaborator Author

MacFJA commented Aug 14, 2023

Yeah, In the past I was testing how to get data.

One of my idea was to also retrieve information from NPM (if the package a well-defined, we have: name, description, repository, homepage, keywords, etc.). It could help to fill missing data.


What we can also do is, instead of replacing with the file only, we can replace the star count if found in the file, or leave as-is from the components.json (or tools, or templates)
(change this line: https://github.com/svelte-society/sveltesociety.dev/blob/main/src/lib/utils/stars.ts#L40 to data.forEach((item) => (item.stars = getStarsCount(item.url) ?? item.stars));)

@benmccann
Copy link
Collaborator

There's not that many, so I don't mind filling in the missing GitHub URLs manually if we make the change I described above.

@MacFJA
Copy link
Collaborator Author

MacFJA commented Aug 15, 2023

Handled here: #438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants