Need/problem
With our plans to make the server source code available, and also provide an SDK that developers can add to their apps to bring runtime capabilities, like runtime intelligence (like Tidewave), I think this presents us with an opportunity to start taking steps towards a monorepo setup under tuist/tuist
.
Motivation
Working across repositories worsens the developer experience. In cases where dependencies like FileSystem or Noora are standalone, mature projects, it makes sense for them to be in their own repository for discoverability reasons. Still, everything else should be in a monorepo, in my opinion.
Detailed design
I propose that we make some changes to GitHub - tuist/tuist: A virtual platform team for mobile devs who ship directory structure to accommodate new projects in the repo:
- Move the CLI code under
cli/
. That includesSources
,Templates
,Tests
,fixtures
,Project.swift
,.xcode-version
files,.swiftlint.yml
and.swiftformat.yml
. - Rename
.github/workflows/tuist.yml
tocli.yml
. - Adjust the
README.md
to reflect the new structure. - Namespace the CLI Mise tasks under
cli
(e.g.mise run cli:build
).
Long-term I expect the structure to be something along the lines of:
/
app/
cli/
docs/
server/
sdk/
README.md
LICENSE.md
...
Drawbacks
A monorepo comes with investment from our side in the tooling and pipelines to ensure we run the right tasks based on file changes. However, tooling is what we excel at, so we have the expertise to handle this kind of work, and we can iterate as we go.
Alternatives
The alternative is to stay in a multi-repo setup, but as I stated earlier, the developer experience is not ideal. Moreover, changes span across repositories, making it harder to reason about feature contributions.
Adoption strategy
With PRs opened, this scan will be a bit painful. We can focus on closing/merging all the existing PRs, but I don’t think that’s very realistic. We can at least try to close as many as we can, and for the remaining, there will have to be a rebase work that needs to happen. I’d say that we support there.