Swiftpack.co - fulldecent/swift5-module-template as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by fulldecent.
fulldecent/swift5-module-template 13.1
An opinionated starting point for awesome, reusable Swift 5 modules
⭐️ 440
🕓 2 years ago
.package(url: "https://github.com/fulldecent/swift5-module-template.git", from: "13.1")

Swift 5 Module Template

Use this template as a starting point for any Swift 5 module that you want other people to include in their projects.

STATUS: This template is ready and works in production code, compatible with Xcode 15.2 (15C500b)

Swift 5 Module directory layout


Your new Swift 5 module will immediately have working, compilable code, and implement these best practices:

  • Ability to be used from Swift Package Manager
  • Clean folder structure
  • MIT license
  • Testing as a standard
  • Turnkey access to GitHub Actions testing
  • Semantic versioning and a CHANGELOG
  • Included example/demo app using SwiftUI
  • Use a Xcode project to manage your code

How to use this

Clone or download a release and run the ./configure.rb program. It will ask you some questions and generate a project.

You then add all the interesting features you want your module to have.

Automating the configure script

To skip interactive prompts in the ./configure script, use these environment variables:

Template variable Environment variable
__TODAYS_DATE__ (date format) SMT_DATE_FORMAT_STRING Note: this will ask you for today’s date but it will use this format in the template.

For example, you may use: export SMT_ORGANIZATION_NAME='Awesome Org' before running ./configure.

How it works

graph LR
    subgraph Contributors to this project
    X[Use Xcode] --> R[Update Recipe.md]
    R --> T[Update template]
    T --> C
    subgraph End users of this project
    C[Run ./configure.rb] --> M[Use your own module]


See the file Recipe.md for the complete steps (e.g. Open Xcode, make new project, click here, type that, …) of how we made the template.


Stars: 440
Last commit: 3 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Support Xcode 13.1
2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics