swyxio / swyxdotio

This is the repo for swyx's blog - Blog content is created in github issues, then posted on swyx.io as blog pages! Comment/watch to follow along my blog within GitHub
https://swyx.io
MIT License
336 stars 45 forks source link

Fixing Up the Svelte Community Site #388

Closed swyxio closed 2 years ago

swyxio commented 2 years ago

source: devto devToUrl: "https://dev.to/swyx/fixing-up-the-svelte-community-site-57c5" devToReactions: 5 devToReadingTime: 3 devToPublishedAt: "2020-02-25T05:47:49.113Z" devToViewsCount: 158 title: Fixing Up the Svelte Community Site published: true description: Adding GitHub Actions and Updating Data Dependencies category: essay tags: Tech, Community, JavaScript, svelte slug: svelte-community-fixup date: 2020-02-24

Canonical URL: https://www.swyx.io/writing/svelte-community-fixup/

One of my longstanding projects that I'm always feeling guilty about not spending time on is the Svelte Community site.

image

At it's surface it is just a simple static site with searchable links to resources, but the vision is that this would hold all the stuff that the official docs and chat would not be able to hold.

Obviously the Svelte maintainers are stretched thin, and I'm just one (busy) guy, so you're welcome to swim on in to contribute if you want to help grow the Svelte community!

I took a couple hours to update it today and here are my public notes from what I did.

Updating the ssg dependency

https://github.com/sveltejs/community/blob/master/package.json#L15

I have been bumping up the ssg version as I tweak features and fix bugs, so just keeping this up to par. I anticipate biting the bullet to move off of Sapper sooner rather than later given I am now consistently running into scaling issues with it on my own site.

Updating the data and data fetching scripts

https://github.com/sveltejs/community/commit/efc0953c5bc399b985d4d75ec9ca21bcb4ef094f

We scrape GitHub stars and npm downloads to give a little indication of the maintenance and adoption status of the ecosystem, this needed to be done on a more regular basis but was written just for a onetime run, so I just ran it once.

Automating Data Scraping with GitHub Actions

I previously wrote about this so I assumed this would be easy, but boy I wasted an hour going nuts with the unintuitive GitHub Actions UI:

2020-02-25 at 12 37 AM

This was because this is what happens when you add a valid GitHub Action:

image

That's right, absolutely no recognition at all from GH Actions that you did something right. Ugh. Took me an hour to verify that nothing went wrong, the GH Actions syntax didnt change, I wasn't going crazy.

The other thing I found out was that you can't add an environment variable prefixed with GITHUB_ as that is a reserved env var. Understandable, but the docs say setting an environment variable or secret with the GITHUB_ prefix will result in an error and there was most certainly no error.

Work, Work

Anyway, the fixup is done, at the cost of some hair pulling from the GH Actions debacle. There is no manual trigger (some hacks here and you can create a custom webhook event if you really need to but ugh) so the only way to tell if this thing will work is to... wait.

The remaining work to do on the Svelte Community Site is:

Once again, if you'd like to help, you're welcome to join us!