Skip to main content

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 repository
  • add-module — add a module repository as a submodule
  • extract — turn a directory here into its own repository

Keeping it current

  • sync — what has moved, and whether the floor holds
  • bump — take the newest version of each module
  • check — fail when this ships older than what it extends
  • inherit — ship what the distribution this extends ships
  • readme — write the module versions into the readmes
  • verify — 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 it
  • env — refuse a deployment missing what its apps need; set it up on Vercel, and rotate its secrets
  • use-https — rewrite ssh submodule urls
  • overrides — resolve modules from the tree, not the registry

Forking a module

  • fork — check a module out from your fork, keeping its upstream
  • contribute — push the change and open a pull request upstream
  • unfork — 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 and verify
  • changelog — check a pull request has its line; print a version's notes
  • canary — stamp a canary version, for CI
  • next-version — after a release, start the next development cycle and decide its version
  • prerelease — 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

OptionMeaning
--cwd <dir>repository to act on, default the working directory
--dry-runreport what would change without changing it
--no-fetchuse the refs already fetched, for offline or CI

Mounting apps into one Next deployment is fg-monolith, in @fairgarden/monolith.