Go packages
dispat is assembled from five Go modules, and you can import each one on its own. Parsing commit messages and rewriting dependency manifests are problems older than releases. These modules are packages first and dispat internals second, so none of them needs the CLI, a git repository, or a network.
Everything else the CLI does lives under services/dispat/internal. Go makes this unreachable from outside the module.
The five packages below are the whole of the importable surface.
The packages
| Module | Import path | What it does |
|---|---|---|
| ccme | github.com/yohimik/dispat/pkg/ccme | Parses commit messages in the Conventional Commits Monorepo Extension format |
| scanner | github.com/yohimik/dispat/pkg/scanner | Reads dependency manifests into one ecosystem-neutral shape |
| writer | github.com/yohimik/dispat/pkg/writer | Rewrites those manifests in place, byte for byte |
| manifest | github.com/yohimik/dispat/pkg/manifest | The vocabulary the reader and the writer share |
| models | github.com/yohimik/dispat/pkg/models | The typed model of the configuration file |
How they fit together
The dependency shape is deliberately shallow, and ccme depends on nothing outside the standard library. Both
scanner and writer import manifest to keep them covering exactly the same formats. models imports ccme
because a resolved configuration carries a parser configuration inside it.
That leaves two natural pairs. scanner and writer are the manifest halves, where one reads a version and the other
writes it, and both agree byte for byte on where the value sits because manifest decides for them. ccme and
models are the input halves, where one reads the commit messages and the other describes the file configuring how
they are read.
Installing
Each module is versioned and tagged separately. They use the layout Go expects for a multi-module repository. A tag
reads pkg/ccme/v1.0.0 rather than a repository-wide version:
go get github.com/yohimik/dispat/pkg/ccme
go get github.com/yohimik/dispat/pkg/scanner
go get github.com/yohimik/dispat/pkg/writer
go get github.com/yohimik/dispat/pkg/manifest
go get github.com/yohimik/dispat/pkg/models
Taking one package does not pull the others in unless it needs them. None of them pulls in the CLI.
The same work from the command line
Three of the packages have a command that wraps the package with a report attached. You do not need a configuration file or a git repository to run them:
dispat scannerprints what a folder's manifests declare.dispat writerapplies manifest edits in place.dispat replacerreplaces literal text in any file.
Run these commands to see what a package does with your own files before you import it.