Overview
- What mounting an app does - (Outline, Contents)
- Starting a repository - (Outline, Contents)
- Mounting - (Outline, Contents)
- Routing - (Outline, Contents)
- What a monolith can serve - (Outline, Contents)
- Next versions - (Outline, Contents)
- Dependencies - (Outline, Contents)
- Keeping modules up to date - (Outline, Contents)
- Portability - (Outline, Contents)
What mounting an app does
A monolith is an ordinary Next app whose route trees are assembled from other apps.
Outline
- Sections:
- It mounts each app
- It merges each app's config
- It tells each app where it is
- It checks they can live together
- It refuses what it cannot serve
- What an app has to give up
Starting a repository
These commands live in @fairgarden/distribution, which owns repository shape,
submodules and versioning.
Outline
- Sections:
- A monolith repository
- A module repository
- Adding a module
- Editing the config
- Submodule URLs
- Being cloneable is more than being https
Mounting
The committed symlinks under src/app/, src/pages/ and public/ are the
source of truth.
Outline
- Sections:
- The two routers behave differently
- Strategies
- Assets
- Two consequences worth knowing
- Self-reference
- When a module cannot be cloned
Routing
Each app's rewrites, redirects and headers are merged into the monolith's,
with every source and destination moved under the app's mount.
Outline
- Sections:
- API routes move differently
- Config that cannot be merged
- Links are not rewritten
What a monolith can serve
Every mounted app's routes have to fit in one tree, and a path can only belong to one of them.
Outline
- Sections:
- An app at the site root
- Collisions are refused, not resolved
- Links are not prefixed for you
Next versions
A mounted app is not built on its own.
Outline
- Sections:
- The rule
- What gets compared
- Upgrading
Dependencies
Listing an app as a dependency of the monolith gets you most of the way.
Outline
- Sections:
- Merging
- What gets taken
- Other commands
Keeping modules up to date
Submodules and versions are handled by fg-dist, in
@fairgarden/distribution.
Outline
- Sections:
- sync
- bump
- What counts as a version
- Safety
Portability
An app does not have to know it is in a monolith, but it does have to avoid a few things.
Outline
- Sections:
- Config and conventions
- Imports