-
-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Project Overview
We should add the PyPi packages in the search dropdown and we should let users review them. Just like they can review NPM Packages :)
The project is a lerna monorepo.
packages/webis the frontend.packages/backendis the backend.
The frontend uses Next.js and React.
The backend is a GraphQL Yoga Server with Queries and Mutations that query Database using Prisma 1.
How to start the development server instructions available in the README.
Files to look at in the Backend
-
schema.tsLine 38
Thetypeneeds to be changed to an enum which would acceptNPMorPYPI. -
backend/src/index.tsLine 84
That line of code was written so that the API was only supporting NPM but now it's gonna change.
Note: That API is just for 3rd party services to access ratings of a package. It isn't used by the frontend.
-
getPackageQuery.tsLine 25
This is where we fetch data from the NPM API to get the data for an NPM package. In this same file, in the same way, we will write the code to fetch the data of a PyPi package. -
searchPackageQuery.tsLine 22
Here as you see, the API is fetching packages from NPM. We will now have to also fetch PyPi packages and merge them with the NPM results.
We will sort the search results properly, on the frontend. -
Every other mutation that writes/deletes/updates/flags the reviews, will have to be updated a little bit so that the mutation would understand that is it updating a PyPi package.
Files to look at in the Frontend
-
meta.jsLine 18
We will have to feature packages from PyPi as well. -
Searchbox Component
Searchbox will have to visually support PyPi results as well. -
/packages/web/pageshave a folder namednpmfor easy Next.js Routing. Now we will have to create similar folder and files forpypias well so that users can review packages on/pypiroute.
I hope the overview is clear enough, now we can create a Pull Request to add this feature.
If you have any questions, feel free to ask 🙌