Creating a standalone Swift package with Xcode | Apple Developer Documentation
Bundle executable or shareable code into a standalone Swift package.