tcmts.cli.migrate

Migrated type
What a migration did.
formatsOf (file: string) => number[]
The hash formats a codebase's definitions are in.
layoutOf (file: string) => string | undefined
The table layout a codebase's database is in (its `layout` setting), if it says.
migrateCodebase (root: string) => (Migrated & { backup: string; verified: number; }) | undefined
Move a codebase to this tcm's table layout and hash format, safely: the database as it was is kept beside it (`codebase.v<n>.sqlite`; `codebase.layout-<layout>.sqlite` when only its tables move), a copy is migrated (`migrateFile`), and the copy is used only if this tcm then reads every live definition back to its hash (`verify`); otherwise the codebase is left as it was. Undefined if it's in this layout and format already.
migrateCopy (file: string) => void
Make a codebase copied from elsewhere readable by this tcm (one a package ships, or suites packed: the tcm that made it may be older, as when a new layout's tcm is packed by the last one): in an older table layout or hash format, the copy is migrated in place. It's a copy, so nothing of it is kept as it was.
migrateFile (file: string) => Migrated
Move a codebase's database (a file nothing else has open) to this tcm's table layout and hash format, in place, in one transaction. A pure function of what's in it, so every copy of a codebase (a clone, a server) migrates to the same hashes and they go on syncing:
remapHashes (v: unknown, map: ReadonlyMap<string, string>) => unknown
A value with every hash in it replaced as `map` says (`h` or `#h`, wherever it is in it); the rest as it was.
testRemapHashes () => void