Great work, this looks awesome @davedelong. Just a few comments
- this hogs the
Timemodule name, ie. it'll clash with anything that has a module calledTime, exported, not exported, private, public, .... Similarly, it takes thetimeURL component and theTimepackage name, all of those have to be unique in a whole package graph as of today
. This package will probably be in conflict with many other packages revealed in this github search. For the SSWG we therefore require some uniqueness, see for example here. -
Timeexports public types likeValue, I'd probably recommend prefixing at leastValuebecause it's such a generic name - For your own benefit, I would recommend not making your
Errortypespublic enums. The language dialect that is used in Swift packages means that all enums are exhaustive so won't be able to add an enum case without making a new major SemVer version
. We messed that up in SwiftNIO and are suffering quite frequently, we intend to fix this for NIO 3 which is a long time out though. I'd recommend using public struct SomethingErrorlike in this example assuming you don't need associated values. If you do need associated values, then your best shot is probably creatingpublic enum TimeErrors {}and nesting all errors as types in there? - regarding public API of a package that I'd expect to be widely used, you might want to check the SwiftNIO docs regarding public API, maybe you get some inspiration.