essential-contributions / essential-server

Centralized implementation of the Essential declarative protocol
Apache License 2.0
0 stars 0 forks source link

refactor: Improve crate and directory name consistency throughout repo #104

Closed mitchmindtree closed 5 months ago

mitchmindtree commented 5 months ago

Closes #67.

This addresses a few small inconsistencies in naming:

essential-server docs

Also adds some small crate root docs to essential-server to clarify that its purpose is to act as a library, and refers to essential-rest-server for an executable implementation.

Removed utils crate

I considered doing utils -> essential-utils, but noticed that the only thing left was the thin Lock wrapper, and as it's only used in memory-storage I moved it into a module there. Let me know if you'd prefer to keep a utils crate around and I can re-add it.

Edit: since re-added - see here.


Besides these, no other changes beyond automated re-ordering of imports were made, despite github struggling to show the diffs properly. I think the server name changes are messing it up a little.

freesig commented 5 months ago

The lock pattern is something that we will likely use in other crates. Maybe we should move it to essential base. I'd really like to have it available especially when writing the node because otherwise people get tempted to use naked mutex with async code which is something I've spent enough of my life debugging to avoid at all costs. We could do this in a follow up pr but I prefer the utils crate was left here as a reminder to do that.

mitchmindtree commented 5 months ago

We could make a little dedicated lock-sync crate in its own repo and publish it to crates.io? Then we could share it between server and node repos for example. Can't imagine it would need much maintenance.

My only beef with utils crates is that they tend to become a bit of a dumping ground for stuff, and can be a bit ambiguous when exposed publicly. But I'll replace it for now and open an issue.

freesig commented 5 months ago

Is there any reason to not put it in the essential base repo? It's pretty similar to the hash or crypto crates

mitchmindtree commented 5 months ago

Yeah true that sounds fine