bluesky-social / indigo

Go source code for Bluesky's atproto services.
https://atproto.com
Apache License 2.0
769 stars 104 forks source link

brainstorm: package refactoring #100

Open bnewbold opened 1 year ago

bnewbold commented 1 year ago

I find the current package names and layout confusing, even after working with them for a while. I'm also not always sure where to put stuff. Here is a draft proposal for how to re-organize things, particularly coming out of the recent lex refactor.

Would be good to push these through before too many folks start building on this repo.

Could do this in stages, or rip the bandaid all at once. Timing-wise, would like to get labelmaker landed before doing any of the more disruptive refactors.

ATP Services

Service Components

These generally mange state, either on-disk or in a SQL database. Sometimes these align with "ecosystem roles" (a "service" might fulfill multiple "roles").

atproto libraries

These are specific to atproto and might be reused by third parties.

lexicon packages

This is kind of bike-sheddy, and i'm not really certain this is the best way to go. But the current api/atproto/ setup, resulting in package name atproto by default, feels pretty confusing to me.

It really feels like the lexutil stuff (LexBlob etc) should live closer to the actual generated lexicons.

Other Packages

Other Changes

bnewbold commented 1 year ago

@bradfitz some earlier thinking on moving packages around when we get a chance, curious if you have any thoughts/feedback on whether these are idiomatic