pulsar-edit / package-backend

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

Fixes in Production #76

Closed confused-Techie closed 1 year ago

confused-Techie commented 1 year ago

Requirements

Description of the Change

When pushing our huge list of changes to production turns out we broke the format of the Package Object Short and Package Object Full. This in turn broke usage of the backend with Pulsar, and with the Frontend Website.

The changes in this PR resolves the issue, by reverting the changes made to depreciate packages.data since we still do require data from this format. Namely (Since we should still do away with this) we missed out on the ReadMe of the repo, the name of the package on Pulsar, and the fact that we can use the metadata key.

If we are able to recreate that functionality then we should be good to go. This will likely mean we need to create a field solely for the Readme, then do a little more work within the package constructor functions.

Otherwise the changes in this PR are already in production.

confused-Techie commented 1 year ago

Should also add, we should probably implement a better way of checking exclusively for object structure on API calls to help prevent an issue like this in the future. Since chaining expects is cumbersome and hasn't always been implemented because of this.

Personally I've been looking at something like Joi (Which I think shields/badges uses for this purpose)