You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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/web is the frontend.
packages/backend is 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.ts Line 38
The type needs to be changed to an enum which would accept NPM or PYPI.
backend/src/index.ts Line 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.ts Line 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.ts Line 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.js Line 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/pages have a folder named npm for easy Next.js Routing. Now we will have to create similar folder and files for pypi as well so that users can review packages on /pypi route.
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 🙌
The text was updated successfully, but these errors were encountered:
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/web
is the frontend.packages/backend
is 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.ts
Line 38The
type
needs to be changed to an enum which would acceptNPM
orPYPI
.backend/src/index.ts
Line 84That line of code was written so that the API was only supporting NPM but now it's gonna change.
getPackageQuery.ts
Line 25This 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.ts
Line 22Here 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.js
Line 18We will have to feature packages from PyPi as well.
Searchbox Component
Searchbox will have to visually support PyPi results as well.
/packages/web/pages
have a folder namednpm
for easy Next.js Routing. Now we will have to create similar folder and files forpypi
as well so that users can review packages on/pypi
route.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 🙌
The text was updated successfully, but these errors were encountered: