Running commands
A repository fg-dist sets up — a distribution from init,
a module given its workflows by workflows — has it as a
devDependency and a dist script, so every command runs the same way:
pnpm dist sync
pnpm dist bump
pnpm dist verify
The binary itself is fg-dist, which pnpm does not put on the PATH. Anywhere
else, add it first, or run it without installing:
pnpm add -D @fairgarden/distribution # then "dist": "fg-dist" in scripts
pnpx @fairgarden/distribution <command>
Setting up
init— scaffold a distribution, monolith or module repositoryadd-module— add a module repository as a submoduleextract— turn a directory here into its own repository
Keeping it current
sync— what has moved, and whether the floor holdsbump— take the newest version of each modulecheck— fail when this ships older than what it extendsinherit— ship what the distribution this extends shipsreadme— write the module versions into the readmesverify— fail when a file fg-dist writes is out of date, for CI
Deploying
migrate— migrate the databases of what a build deploys, after building itenv— refuse a deployment missing what its apps need; set it up on Vercel, and rotate its secretsuse-https— rewrite ssh submodule urlsoverrides— resolve modules from the tree, not the registry
Forking a module
fork— check a module out from your fork, keeping its upstreamcontribute— push the change and open a pull request upstreamunfork— go back to upstream once it has the fork's work
See Forking a module.
The organization's policy
policy— build and test it, give each service its copy, and have turbo build it once
Releasing a module
workflows— give every module a publishing workflow, a changelog check andverifychangelog— check a pull request has its line; print a version's notescanary— stamp a canary version, for CInext-version— after a release, start the next development cycle and decide its versionprerelease— start the next line on a branch, leaving main where it is
A module releases on its own schedule; see
Releasing a module. A distribution others extend
publishes too — workflows --distribution, and next-version starts each next version;
see Extending.
Shared options
| Option | Meaning |
|---|---|
--cwd <dir> | repository to act on, default the working directory |
--dry-run | report what would change without changing it |
--no-fetch | use the refs already fetched, for offline or CI |
Mounting apps into one Next deployment is fg-monolith, in
@fairgarden/monolith.