I'm trying to accomplish the same package organization as this one https://github.com/pointfreeco/swift-composable-architecture. The features I would like to achieve are the following:


I've tried:
Package.swift won't be at the root of the repo, so this won't work.File > New > Package. Then created the empty workspace in the same folder. Opened it and drag the package folder onto it. Then added a new app project linking it with the package I will be building. It all seems to work fine. However, now I'm leaving with the Example folder inside my package and I cannot just simply delete the reference to it. Only lets me delete the entire folder.
Here's what I recommend, as demonstrated in https://github.com/MacPaw/OpenAI 's structure (also derived from swift-composable-architecture's.
Root
|-- Package.swift << Your package
|-- Sources/ << containing your package sources
|-- Demo << Companion app
|-- Demo.xcodeProj
|-- App/... << the wiring code of your demo project
|-- DemoPackage
|- Package.swift << Your demo app's package, it should declare dependency on the package of your Root ../..
|- OtherFiles.swift
To summarize,
DemoPackage, which depends on your Root package ../... This package can contain the bulk of your business logic of your companion app.DemoPackage locally to your demo app project. Add light wiring wrapper to reference your DemoPackage.This way, you can write demo app inside a package you offer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With