drone-node icon indicating copy to clipboard operation
drone-node copied to clipboard

Re-work the architecture

Open unflores opened this issue 3 years ago • 0 comments

I was thinking that different resources would probably change together. Repositories, Builds, Users, and it may be nice to have them co-located. It would allow the splitting of tests too. This might be a nice change

This would give us an api like the following:

client.repositories.get('drone', 'drone-node')
client.repositories.enable('drone', 'drone-node')
client.repositories.disable(drone', 'drone-node')

I don't think we would be able to do that without breaking changes. We could do something like this though:

  1. Finish adding the specs for all of the endpoints
  2. Move resources such as Repositories into their own folder.
  3. Add Object.setPrototypeOf(Client.prototype, Repositories.prototype) to client. This would allow 2. to be non-breaking.
  4. Change interface of resources, remove setPrototypeOf and bump major version.

This is probably more than you want to take on, but I thought it was a cool idea and figured I would communicated it nonetheless.

unflores avatar Apr 30 '22 11:04 unflores