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

feat: Extensions/Projects page on the Gate Website #424

Merged
merged 18 commits into from
Nov 16, 2024

Conversation

dilllxd
Copy link
Contributor

@dilllxd dilllxd commented Nov 15, 2024

This PR adds an Extensions/Projects page to the Gate Website. This would allow users to add their own Plugins/Extensions for Gate to the Gate website by adding the topic gate-extension to their repo! This also allows users to see what projects are importing Minekube Libraries in their go.mod file.

All API work is done through Cloudflare Pages functions, and we currently cache all repo's locally in browser and also a KV in Cloudflare to stay within GitHub's API and Cloudflare's limits.

I still have some small things to change (like the url title) but this is technically ready to merge whenever it has been checked over and the required changes to the Cloudflare Pages deployment settings have been added. Sorry for the low commits btw, most of the work was done locally :)

Pictures:

Extension Page
Minekube Libraries Page

wip, still testing pages worker
had functions in the wrong folder i believe
Automatically adjusts page title to Extensions or Minekube Libraries based on the current search mode being used.
@dilllxd
Copy link
Contributor Author

dilllxd commented Nov 15, 2024

I just pushed the feature to automatically update the webpage title based on what search mode is being used so technically I think the current wanted features are done. I also wanted to see opinions on if it should be added to the homepage with a button next to quick start and a new nav link on the header. I attached a picture showing how it looks currently with it added to both places.
Plus, I'm not exactly sure what we should label it as. Extensions made sense at first as it was only originally going to be Gate extensions but it's now been expanded to projects that import go.minekube.com so I'm not sure what it should be named lmk your opinions on that as well :)

image

Added the ability to show cached data in the browsers localstorage if the API is down/unable to be reached. If no cached data is found message shown is "Error reaching the API. To see updated results, please try again later. " If cached data is found, it is shown and a message saying "Warning: Showing locally cached results. To see updated results, please try again later. " is shown above the results.
@dilllxd
Copy link
Contributor Author

dilllxd commented Nov 15, 2024

Added the ability to show cached data stored in the browsers localstorage if the api is unreachable for some reason. Here's pictures of what is shown for each type of situation (1. cached data, but api is unreachable 2. no cached data and api is unreachable)

number 1
number 2

Forgot to check for browser env when using localstorage since it breaks yarn build.
cached message was showing due to us using cached data on second refresh to reduce api calls, we should only show the cached data message if we are using it as fallback due to api being unreachable
i wish I could test this without commiting lol
@dilllxd dilllxd marked this pull request as ready for review November 16, 2024 02:09
@oglassdev
Copy link

bro took a small amount of inspiration from the minestom website

@dilllxd
Copy link
Contributor Author

dilllxd commented Nov 16, 2024

bro took a small amount of inspiration from the minestom website

@oglassdev Haha yeah, their page fit really well with what I wanted so I tried to remake it. This was my first time using vitepress so it helped to have something to bounce off of when working on it. I want to try and experiment with other designs soon though and see if anything would work better since the Minekube Libraries page might get cluttered as the libraries get used more and more. If you have any ideas feel free to lmk and I’ll try and work on them (:

@robinbraemer
Copy link
Member

Exciting! It is much better than the initial requirements!

Copy link
Member

@robinbraemer robinbraemer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

minor future improvements:

  • ui: make the search consider both the repo description in addition to the name
  • ui: display the two search modes switches to visible
  • code: extract duplicate code into a shared js file imported by both extensions.js and go-modules.js

@robinbraemer robinbraemer merged commit 81a1528 into minekube:master Nov 16, 2024
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.

3 participants