midad vendor

midad vendor <dir> [--into DIR]

Copies a library's .md files into a project and records what was copied. --into names the destination and defaults to lib/<name>.

$ midad vendor ~/src/midad-web --into lib/web
8 files vendored into lib/web from ~/src/midad-web

It also writes lib/web/.vendor, a fingerprint of each file and the path it came from. midad check reads it back:

W003: lib/web/view.md has changed since it was vendored from ~/src/midad-web:
run `midad vendor ~/src/midad-web --into lib/web` to refresh it, or delete
lib/web/.vendor if you meant to fork it

A fingerprint, not a signature: it catches accidental drift and will not stop anyone who wants to forge it. Vendoring is flat, because a nested copy would change the relative paths the library's files import each other by.

On this page