web-padawan / webcomponents.today

A curated collection of Web Components resources.
https://webcomponents.today
MIT License
101 stars 7 forks source link

Submissions and contributions #47

Open daviddarnes opened 3 months ago

daviddarnes commented 3 months ago

Hey @web-padawan!

I wanted to ask if this project is still in active development and is open to submissions or contributions? I've been working on a series of open source Web Components and it would be great if they were accepted into the Standalones section of the site. However I wanted to reach out before I started overwhelming you with PRs.

I've also gotten in touch with @davatron5000 who maintains awesome-standalones, I wonder if there's a way for all of us to collaborate? Maybe use the repo as a DB and the site as the presentation? I've got decent experience with Eleventy so I think I can connect the two.

Just thought I'd throw out an olive branch for collaboration 💙

web-padawan commented 3 months ago

Hi, thanks for reaching out. I haven't been working on this project lately, but it's open to contributions. If you have some ideas, feel free to propose them and I'll see what we can do.

daviddarnes commented 3 months ago

Great to hear. I was considering the idea of making a standalones website for open-source web components, but yours and Dave's listings seem to already the main places people are looking.

I think a good way to collaborate would be to do the following:

Smooth out the contribution process on the awesome-standalones repo and update the list. We can do that with something like Eleventy but inside of GitHub Actions, which could generate the README.md that's already shown there from a data file. That data file would most likely be a big JSON file. And since your site is built with Eleventy, it should have no problem consuming that data file to render them on the standalones page.

I realise this sounds fairly complex, but I think the result would be beneficial to everyone. One easy-to-maintain source of truth with a contribution process that's more streamlined (similar to how Zach accepts plugin submissions on 11ty.dev).

Thoughts welcome!

daviddarnes commented 3 months ago

@web-padawan myself and @davatron5000 have now updated https://github.com/davatron5000/awesome-standalones to run on Eleventy under the hood, as well as catch up with the existing submissions. I'm now thinking as a collaborative endeavour that the Standalones page on https://webcomponents.today be sourced from the awesome-standalones project. This can be done very easily in Eleventy using the fetch plugin like so:

const EleventyFetch = require("@11ty/eleventy-fetch");

module.exports = function (eleventyConfig) {
  let url =
    "https://raw.githubusercontent.com/davatron5000/awesome-standalones/main/src/_data/standalones.json";

  /* This returns a promise */
  eleventyConfig.addGlobalData("standalones", async () => {
    return EleventyFetch(url, {
      duration: "1d",
      type: "json",
    });
  });
};

Note that the data is being sourced from a JSON file we use to help generate the main readme.md on the project. The only other thing we'd need to do is copy over the existing standalones you have in your data file.

What does everyone think of this idea? Please don't let my thoughts dictate the direction. I'm not here to take away credit from people but to help Web Components thrive and lighten everyone's load in helping share resources in the community.