pulsar-edit / package-backend

Pulsar Server Backend for Packages
https://api.pulsar-edit.dev
MIT License
12 stars 11 forks source link

Refactored and moved logic of `package_handler.js` #115

Closed confused-Techie closed 1 year ago

confused-Techie commented 1 year ago

Requirements

Description of the Change

This PR refactors ./src/handlers/package_handler.js. The file had become over 1000 lines long, and many of the changes being needed recently only effected a small subset of that code, increasing the possibility of conflicts and increasing complexity to deal with the file, and difficulty finding the right parts of the code to make changes on.

This PR provides no real change to how the code runs, all it does is simply expand things a bit, to move the contents of package_handler.js into several new files accomplishing the same tasks, having moved the contents into:

The idea here is simply to make each file easier to keep in mind, and find what's needed to make additional changes or improvements.

We still use package_handler.js to help export all of these handlers under the correct function names so that they can be consumed with zero change by main.js and by tests.